Skip to content

Conversation

@ExactDoug
Copy link

Bullet lists were not rendering correctly in exported .docx and .html files. Lists would collapse into single paragraphs instead of maintaining their structure.

Root cause: Pandoc was using strict CommonMark format which requires blank lines before lists. However, many markdown files have lists immediately after text without spacing (e.g., after colons), which is valid in GitHub Flavored Markdown and markdown-it (the preview renderer).

Solution: Specify 'gfm' (GitHub Flavored Markdown) as the input format when calling pandoc. This ensures consistency between preview rendering and export output, so what you see in the preview matches what gets exported.

This change affects all export formats (.docx, .html, .pdf, etc.) and makes the export behavior match the preview behavior for bullet lists.

Bullet lists were not rendering correctly in exported .docx and .html files.
Lists would collapse into single paragraphs instead of maintaining their structure.

Root cause: Pandoc was using strict CommonMark format which requires blank lines
before lists. However, many markdown files have lists immediately after text
without spacing (e.g., after colons), which is valid in GitHub Flavored Markdown
and markdown-it (the preview renderer).

Solution: Specify 'gfm' (GitHub Flavored Markdown) as the input format when
calling pandoc. This ensures consistency between preview rendering and export
output, so what you see in the preview matches what gets exported.

This change affects all export formats (.docx, .html, .pdf, etc.) and makes
the export behavior match the preview behavior for bullet lists.
@mb21
Copy link
Owner

mb21 commented Dec 1, 2025

Yeah, a few inconsistencies like that are annoying. My plan was kind of to wait for pandoc to switch its default parser to commonmark. Probably not worth it to force the default in PanWriter. You can always specify a custom from key in the default config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants