Skip to content

Releases: edadma/markdown

v0.4.4

07 May 22:50

Choose a tag to compare

Bug fix

  • Fix MatchError: Paragraph(...) in DefinitionListBlock rendering. The
    renderer was calling the public renderToHTML(node, config) on each
    definition body, but that entry point only handles Document and
    threw a MatchError for the Paragraph every parsed definition body
    actually contains. Now goes through renderBlockToHTML directly,
    which handles all Block subtypes uniformly. Regression test added
    in DefinitionListBlockParserTest.

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

07 May 13:35

Choose a tag to compare

Highlights

  • New: auto-generated heading IDs. Set MarkdownConfig.autoHeadingIds = true to have every <hN> get an id attribute slugified from its text content. The slugify function is pluggable; the default matches Hugo / mkdocs / GitHub.
  • New: AST-consumer helpers. Document.headings, public renderInlines, public plainText — 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, exposing renderToHTML / 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_platform 0.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/markdown

v0.4.0

05 Apr 13:12

Choose a tag to compare

Highlights

  • Doc-tag extension (opt-in): @name [target] — body block-level annotations for API documentation tooling. Configurable per-tag via a TagRegistry with acceptsTarget flag and ContentMode (Opaque/InlineMarkdown/BlockMarkdown). Unknown tags fall back to plain text in strict mode or emit lenient DocTagBlock nodes 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

02 Apr 18:37

Choose a tag to compare

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: findOpener correctly 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

01 Apr 12:38

Choose a tag to compare

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