Skip to content

feat(definition-list): render definition lists to <dl>/<dt>/<dd>#142

Open
lolifamily wants to merge 1 commit into
bruits:mainfrom
lolifamily:feat/definition-list
Open

feat(definition-list): render definition lists to <dl>/<dt>/<dd>#142
lolifamily wants to merge 1 commit into
bruits:mainfrom
lolifamily:feat/definition-list

Conversation

@lolifamily

Copy link
Copy Markdown

Closes #106

Add a definitionList feature (off by default) following the pandoc / PHP Markdown Extra syntax: a term line followed by one or more colon-marked definitions parses into new descriptionList, descriptionTerm, and descriptionDetails mdast nodes, rendered as <dl>/<dt>/<dd>.

  • Tight vs loose is tracked per definition: spread lives on each descriptionDetails (mirroring mdast-util-definition-list), so a loose <dd> keeps its inner <p> while a tight one unwraps it, reusing the existing list-item paragraph-unwrap path.
  • The definition marker only claims a lone colon, so a ::/::: fence still parses as a directive when both extensions are enabled. Covered by dedicated regression tests for the colon interaction.
  • The three nodes are wired through the full pipeline: layout-codegen registry, walk/reader decoders, plugin visitor keys, prop slots, and the op-stream round-trip, plus features / plugin-api docs.

This also replaces the earlier stub that mapped definition-list syntax onto nested paragraphs, fixing the malformed <p><p>...</p></p> output in the #949 regression snapshots.

The build additionally refreshes the checked-in napi bindings (index.js, wasi-worker-browser.mjs), which had drifted to 0.8.1 while the package is already at 0.9.4 — an incidental artifact refresh, not a functional change.

Add a `definitionList` feature (off by default) following the pandoc /
PHP Markdown Extra syntax: a term line followed by one or more
colon-marked definitions parses into new `descriptionList`,
`descriptionTerm`, and `descriptionDetails` mdast nodes, rendered as
`<dl>`/`<dt>`/`<dd>`.

- Tight vs loose is tracked per definition: `spread` lives on each
  `descriptionDetails` (mirroring mdast-util-definition-list), so a
  loose `<dd>` keeps its inner `<p>` while a tight one unwraps it,
  reusing the existing list-item paragraph-unwrap path.
- The definition marker only claims a lone colon, so a `::`/`:::`
  fence still parses as a directive when both extensions are enabled.
  Covered by dedicated regression tests for the colon interaction.
- The three nodes are wired through the full pipeline: layout-codegen
  registry, walk/reader decoders, plugin visitor keys, prop slots, and
  the op-stream round-trip, plus features / plugin-api docs.

This also replaces the earlier stub that mapped definition-list syntax
onto nested paragraphs, fixing the malformed `<p><p>...</p></p>` output
in the #949 regression snapshots.

The build additionally refreshes the checked-in napi bindings (index.js,
wasi-worker-browser.mjs), which had drifted to 0.8.1 while the package is
already at 0.9.4 — an incidental artifact refresh, not a functional change.
@codspeed-hq

codspeed-hq Bot commented Jul 2, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 24 untouched benchmarks
⏩ 8 skipped benchmarks1


Comparing lolifamily:feat/definition-list (5c4a5db) with main (ef3974e)

Open in CodSpeed

Footnotes

  1. 8 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Defination List

1 participant