Answer the question
In order to leave comments, you need to log in
How to remove extra indentation when compiling Jade in mixins?
Usually all jade mixins are included in a separate file and all mixins in it start without indents, but if the mixin needs to be entered inside the main document hierarchy, then extra indents are compiled
<!DOCTYPE html>
html
head
title Document
body
h1 Main title
.content
.inner-content
mixin rand
p Лишние отступы
.text
+rand
<!DOCTYPE html>
<html></html>
<head>
<title>Document</title>
</head>
<body>
<h1>Main title</h1>
<div class="content">
<div class="inner-content">
<div class="text">
<p>Лишние отступы</p>
</div>
</div>
</div>
</body>
Answer the question
In order to leave comments, you need to log in
Walk through the html with a pretifier using gulp-prettify for this with the following parameters
{
'unformatted': ['pre', 'code'],
'indent_with_tabs': true,
'preserve_newlines': true,
'brace_style': 'expand',
'end_with_newline': true
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question