Skip to content

feat: render YAML frontmatter as HTML table in markdown preview - #76

Open
dolan-a wants to merge 2 commits into
chrishrb:mainfrom
dolan-a:feat/render-frontmatter
Open

feat: render YAML frontmatter as HTML table in markdown preview#76
dolan-a wants to merge 2 commits into
chrishrb:mainfrom
dolan-a:feat/render-frontmatter

Conversation

@dolan-a

@dolan-a dolan-a commented Jul 27, 2026

Copy link
Copy Markdown

Add pkg/frontmatter with Extract and RenderTable functions. Extract detects a leading --- delimited YAML block at byte offset 0, validates the YAML, and returns the frontmatter bytes and remaining body. RenderTable converts the parsed YAML into a bordered HTML table with document-order keys and HTML-escaped values.

Wire the pre-processing step into internal/parser.MdToHTML so any markdown file with valid frontmatter renders a table above the body instead of the garbled H2 heading Goldmark produced before.

Closes #75

dolan-a added 2 commits July 27, 2026 08:25
Add pkg/frontmatter with Extract and RenderTable functions. Extract
detects a leading --- delimited YAML block at byte offset 0, validates
the YAML, and returns the frontmatter bytes and remaining body.
RenderTable converts the parsed YAML into a bordered HTML table with
document-order keys and HTML-escaped values.

Wire the pre-processing step into internal/parser.MdToHTML so any
markdown file with valid frontmatter renders a table above the body
instead of the garbled H2 heading Goldmark produced before.

Closes chrishrb#75
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.

Render YAML frontmatter as an HTML table instead of an H2 heading

1 participant