Skip to content

Commit 63af3de

Browse files
committed
fix: Fix wonky md list rendering when trailing spaces are present on lines following lists
1 parent fbf7c4a commit 63af3de

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

web/src/markdown.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ const dedent = (block: S): S => {
4848
const indent = getSpaceIndentation(lines) || getTabIndentation(lines)
4949
return indent === 0
5050
? block
51-
// don't dedent empty lines
52-
: lines.map(s => s.length > indent ? s.substring(indent) : s).join('\n')
51+
: lines.map(s => s.length > indent ? s.substring(indent) : s) // don't dedent empty lines
52+
.map(s => s.trimEnd()) // Workaround for a bug in micromark - trailing spaces trip up list rendering
53+
.join('\n')
5354
}
5455

5556
// Micromark encodes these chars inside <pre><code> blocks, which trips up highlight.js.

0 commit comments

Comments
 (0)