Answer the question
In order to leave comments, you need to log in
How to disable inline-tags on compilation in Pug?
Hello.
How to cancel inline-tags in Pug (task manager - Gulp) when compiling?
There is a code
.links
a(href='#').link: img(src='img/some-img.png' alt='')
a(href='#').link: img(src='img/some-img.png' alt='')
a(href='#').link: img(src='img/some-img.png' alt='')
a(href='#').link: img(src='img/some-img.png' alt='')
<div class="links"><a href="#" class="link"><img src="img/some-img.png" alt=""/></a><a href="#" class="link"><img src="img/some-img.png" alt=""/></a><a href="#" class="link"><img src="img/some-img.png" alt=""/></a><a href="#" class="link"><img src="img/some-img.png" alt=""/></a></div>
<div class="links">
<a href="#" class="link">
<img src="img/some-img.png" alt=""/>
</a>
<a href="#" class="link">
<img src="img/some-img.png" alt=""/>
</a>
<a href="#" class="link">
<img src="img/some-img.png" alt=""/>
</a>
<a href="#" class="link">
<img src="img/some-img.png" alt=""/>
</a>
</div>
Answer the question
In order to leave comments, you need to log in
I found a miracle plugin that solves the problem of the author, I decided to share it.
gulp-format-html
A very necessary thing, I myself suffered for a long time with these inline tags.
Other ways to format the text did not help me, including gulp-html-prettify.
{ pretty: true }
[Deprecated.] Adds whitespace to the resulting HTML to make it easier for a human to read using ' ' as indentation. If a string is specified, that will be used as indentation instead (eg '\t').
https://pugjs.org/api/reference.html
may be useful to someone)
npm i prettier --save-dev
// package.json
"scripts": {
"pretty": "prettier --write ./dist/*.html"
},
// .prettierrc.json
{
"htmlWhitespaceSensitivity": "ignore",
"printWidth": 128
}
npm run pretty
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question