Releases: edadma/markdown
Releases · edadma/markdown
v0.4.4
Bug fix
- Fix
MatchError: Paragraph(...)inDefinitionListBlockrendering. The
renderer was calling the publicrenderToHTML(node, config)on each
definition body, but that entry point only handlesDocumentand
threw aMatchErrorfor theParagraphevery parsed definition body
actually contains. Now goes throughrenderBlockToHTMLdirectly,
which handles allBlocksubtypes uniformly. Regression test added
inDefinitionListBlockParserTest.
Tests
- 995 / 995 passing across JVM / JS / Native, including all 652
CommonMark 0.31.2 spec tests.
Full changelog: v0.4.3...v0.4.4
v0.4.3
Highlights
- New: auto-generated heading IDs. Set
MarkdownConfig.autoHeadingIds = trueto have every<hN>get anidattribute slugified from its text content. Theslugifyfunction is pluggable; the default matches Hugo / mkdocs / GitHub. - New: AST-consumer helpers.
Document.headings, publicrenderInlines, publicplainText— the bits TOC builders, anchor-text generators, and search-index excerpters keep reinventing. - New: npm package
@edadma/markdown. The linked Scala.js bundle plus full TypeScript typings, exposingrenderToHTML/extractHeadings/plainText/version. ESM, types pointer, drop-in for any JS / TS project. - Fix: setext heading vs fenced code precedence. A line that opens a fenced code block (```` or
~~~) is no longer incorrectly claimed as a setext heading when the next line is `---`. Surfaced when feeding YAML-style frontmatter inside fenced examples to the parser. - Fix:
String.replace("\\u0000", ...)on Scala Native. The CharSequence overload couldn't handle the null byte (C-string terminator). Now uses the(Char, Char)overload — Native test suite is fully green for the first time. - Bump:
cross_platform0.1.3 → 0.1.6 (transitive); plugin / sbt refresh.
Test sweep
994 / 994 active green on JVM, Scala.js, and Scala Native. All 652 official CommonMark 0.31.2 spec tests still pass plus the expanded local suite (helpers, auto heading IDs, setext-vs-fence regressions).
Install
Scala (sbt)
libraryDependencies += "io.github.edadma" %%% "markdown" % "0.4.3"JavaScript / TypeScript (npm)
npm install @edadma/markdownv0.4.0
Highlights
- Doc-tag extension (opt-in):
@name [target] — bodyblock-level annotations for API documentation tooling. Configurable per-tag via aTagRegistrywithacceptsTargetflag andContentMode(Opaque/InlineMarkdown/BlockMarkdown). Unknown tags fall back to plain text in strict mode or emit lenientDocTagBlocknodes by default. - Footnotes (opt-in):
[^label]references with[^label]: ...definitions. Backref link injection; numbered by first-reference order. - Smart punctuation (opt-in): curly quotes, en/em dashes, ellipsis.
- Attributes / spans (opt-in):
{#id .class key=value}on headings, fenced blocks, images.
Toolchain
- Upgraded to Scala 3.8.3 and sbt 1.12.8.
Conformance
All 877 CommonMark 0.31.2 spec tests continue to pass.
v0.2.0
Full CommonMark 0.31.2 Spec Compliance
All 877 spec tests passing across all 25 sections — 100% CommonMark 0.31.2 compliance.
Highlights
- HTML block parser rewrite: proper type 1–7 classification with correct start/end conditions
- List items: empty item blank line handling, tight list rendering fixes
- Lists: loose/tight detection accounts for consumed link reference definitions
- Emphasis: Unicode whitespace/punctuation classification, delimiter skip fix
- Links: link-in-link detection prevents invalid nesting per spec
- Inline parsing:
findOpenercorrectly stops at first[/!delimiter regardless of active status
New Features
- Syntax highlighting support for fenced and indented code blocks via pluggable highlighter function
v0.0.23
Changes
- Build toolchain update: Scala 3.8.2, sbt 1.12.4, Scala.js 1.20.2, Scala Native 0.5.10, Sonatype Central publishing
- Code.indented field: Distinguish indented code blocks from fenced code blocks in the AST
- CollapsibleBlock inline titles: Title is now
List[Inline]for inline formatting support (bold, links, etc.) - Bug fixes: Indented code block whitespace preservation, loose list item rendering
- Spec compliance: Added CommonMark spec tests for indented code blocks and paragraphs
- Dependencies: cross_platform 0.1.3, scalafmt 3.10.7