gpt4 book ai didi

javascript - Gulp HTML 缩小自定义标签不起作用

转载 作者:行者123 更新时间:2023-11-30 06:10:37 25 4
gpt4 key购买 nike

这是我的 HTML 页面的简短版本,其中包含 <xmp>对于代码片段标签:

<div class="container">
<a href="#">Aqua Dotted Link - Default</a>

<br /><br />

<a href="#" class="a-gold">Gold Dotted Link</a>

<h3>Code for Footer: </h3>
<pre><code><xmp><u>This is U tag with underlined aqua - Default </u>

<u class="u-gold">This is U tag with underlined gold</u>

<u class="u-orange">This is U tag with underlined orange</u></xmp></code></pre>

<p>Hello World</p>

<p>Hello World 2</p>
</div>

gulp-htmlmin我正在我的 gulpfile.js 中执行以下操作:

let htmlmin = require('gulp-htmlmin');

...

gulp.task('html', gulp.series('clean', function() {
return gulp.src(globs.html)
.pipe(htmlmin({
collapseWhitespace: true,
removeComments: true,
}))
.pipe(gulp.dest('./dist'));
}));

...

我不知道出了什么问题,但这是我得到的输出:

<div class=container><a href=#>Aqua Dotted Link - Default</a><br><br><a href=# class=a-gold>Gold Dotted Link</a><h3>Code for Footer:</h3><pre><code><xmp><u>This is U tag with underlined aqua - Default </u>

<u class=u-gold>This is U tag with underlined gold</u>

<u class=u-orange>This is U tag with underlined orange</u></xmp></code></pre><p>Hello World<p>Hello World 2</div>

如何让 gulp 识别 <xmp>标记以便它可以缩小它?

最佳答案

<xmp>obsolete .

尝试使用<pre><code>而不是 <xmp> .

关于javascript - Gulp HTML 缩小自定义标签不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59101113/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com