Skip to content

Commit 24dd8d2

Browse files
committed
fix: rendering of Markdown inline formatting and bullet lists (#1156)
Markdown inline formatting (**bold**, *italic*, `code`) and bullet lists using "- " markers were not rendered in the HTML output. Inline formatting: - Add `appendMarkdownInlines()` to parse **bold**, *italic*, and `code` spans in text nodes, producing `StrongInline`, `EmphInline`, and `CodeInline` nodes respectively. - Call it from `visitText()` so all text nodes are processed. - Add a markup/b.html.hbs partial to render <strong> tags. - Add doc/inline.html.hbs to dispatch text, strong, emph, and code inline kinds to their partials without emitting extraneous blank lines. List detection and conversion: - Add list marker detection functions that recognize "- " at the start of text, after newlines, after ":" or "." punctuation, and at trailing positions within already-started lists. - Add `convertParagraphWithLists()` to split a paragraph containing list markers into a prefix paragraph and a `ListBlock`. - Apply list detection in `visitParagraph()`, `@par` blocks, and `@li` blocks so that Markdown lists are converted in all contexts.
1 parent 58bf524 commit 24dd8d2

File tree

5 files changed

+436
-9
lines changed

5 files changed

+436
-9
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{{~#if (eq kind "text")~}}{{> doc/inline/text}}{{~/if~}}
2+
{{~#if (eq kind "strong")~}}{{> doc/inline/strong}}{{~/if~}}
3+
{{~#if (eq kind "emph")~}}{{> doc/inline/emph}}{{~/if~}}
4+
{{~#if (eq kind "code")~}}{{> doc/inline/code}}{{~/if~}}
5+
{{~#if (eq kind "link")~}}{{> doc/inline/link}}{{~/if~}}
6+
{{~#if (eq kind "reference")~}}{{> doc/inline/reference}}{{~/if~}}
7+
{{~#if (eq kind "copy-details")~}}{{> doc/inline/copy-details}}{{~/if~}}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<strong>{{> @partial-block }}</strong>

0 commit comments

Comments
 (0)