Html Pug(Jade)在gulp build上的格式化标签之间添加额外空间
我用大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大。问题在于dist代码由于生成时的格式设置而有额外的空间 伪代码:Html Pug(Jade)在gulp build上的格式化标签之间添加额外空间,html,gulp,pug,Html,Gulp,Pug,我用大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大口大。问题在于dist代码由于生成时的格式设置而有额外的空间 伪代码: label each item in items span if kkk == 2 =item[1] else abbr(title='ttttttt') =elem 结果(dist.html)如下所示: <
label
each item in items
span
if kkk == 2
=item[1]
else
abbr(title='ttttttt')
=elem
结果(dist.html)如下所示:
<label for="ааааа">set to
<abbr title="Scalable Vector Graphics">SVG/</abbr>
<abbr title="Joint Photographic Experts Group">JPEG</abbr>
</label>
换言之,我们需要
<abbr title="Scalable Vector Graphics">SVG/</abbr>
<abbr title="Joint Photographic Experts Group">JPEG</abbr>
SVG/
JPEG
在生成的生成(dist)代码中只有一行:
SVG/JPEG
显示:内联块;什么都不会改变。检查了其他几个类似的问题-与此问题无关。恐怕没有优雅的方法解决这个问题 如果你想快速解决问题,我建议你
如果您想从Pug的角度解决这个问题,可以尝试禁用Pug中经过修饰的HTML输出(
{pretty:false}
)?不确定在这种情况下它是否会修复它,但它可能会修复(但是,生成的HTML不再漂亮)。谢谢!字体大小0让我想到尝试字母间距:-10px,这很有帮助!!字体大小0稍微破坏了格式设置。我还将标签词包装到div中,以使样式与跨样式不同。
<abbr title="Scalable Vector Graphics">SVG/</abbr>
<abbr title="Joint Photographic Experts Group">JPEG</abbr>
<abbr title="Scalable Vector Graphics">SVG/</abbr><abbr title="Joint Photographic Experts Group">JPEG</abbr>