Turns out that a simple replacement doesn't work, so explore about why.
Markdown is annoying... but normalizePadding() is not my proudest moment. Would love to see it be replaced with something simpler.
Looks like indentation processing is weird on normalizePadding(). For example:
<section id='sotd'><p>foo</p></section><section id='toc'></section>
# Title
Some text
Per the markdown spec, the text should be interpreted as <pre> because of its indentation. Instead, the function tends to interpret it as normal unindented markdown by trimming the text and all its indentations.
Correct... so, this is for legacy reasons. People were writing markdown inside the body indented like that:(
Is there a live example? I saw this on our tests that appends indented template string. I don't think the tests did it intentionally...
I’ll dig some up.
Hello from 2012!
🤦♀️
Heh, yep. Kinda stuck. But we could make a case to break things for sanity’s sake.
@saschanaz do you think we can do anything here? Or “abandon all hope”?
@marcoscaceres I think we should learn exactly what behavior differences exist, add some tests for them, and then we can revisit this. For now it's rather a black box...