Rehype HTML Prettifier #197
-
|
Hi, I would like to prettify my HTML with a few custom style rules. Before: <div id="test-id-1" class="test" data-test="test">
<p>Test</p>
</div>
<div id="test-id-2" class="test">
<p>Test</p>
</div>After: <div
id="test-id-1"
class="test"
data-test="test"
>
<p>Test</p>
</div>
<div id="test-id-2" class="test">
<p>Test</p>
</div>I found rehype-format, but this only seems to format white-spaces. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
I know there is also prettier, which I assume can format HTML as well, but with 7mb it's a large dependency with a huge feature set. |
Beta Was this translation helpful? Give feedback.
-
|
rehype-stringify + rehype-format
This idea of multi-attributes on different lines would mean that you make your own version of Similar features are available for JSX in markdown, but not for HTML. |
Beta Was this translation helpful? Give feedback.
rehype-stringify + rehype-format
This idea of multi-attributes on different lines would mean that you make your own version of
rehype-stringify.Similar features are available for JSX in markdown, but not for HTML.