Fix formatting of unparseable {% javascript %}, {% style %} with useTabs
Fix printing of HTML raw nodes surrounded by meaningful lack of whitespace
Fix idempotence of all "raw"-like tags when useTabs is used
script, style, svg
{% javascript %}, {% style %}
Explanations
reindent used ' ' instead of \s to strip the whitespace at the beginning, so it failed to be idempotent when tabs were used. Tabs just kept being added.
Added logic to make sure tags that are indentation sensitive (css whitespace: pre) print without modification.
Bonus: Fixed tag borrowing in situation where the next node is an HtmlRawNode. Would be surprising to see in the wild but sounds better this way.
In this PR
capture
tags{% javascript %}
,{% style %}
withuseTabs
useTabs
is usedscript
,style
,svg
{% javascript %}
,{% style %}
Explanations
reindent
used' '
instead of\s
to strip the whitespace at the beginning, so it failed to be idempotent when tabs were used. Tabs just kept being added.whitespace: pre
) print without modification.Fixes #66 Fixes #89