Skip to content

chore: release v0.4.0 - #13

Closed
github-actions[bot] wants to merge 1 commit into
mainfrom
release-plz-2026-10-06T02-38-45Z
Closed

github-actions[bot] wants to merge 1 commit into
mainfrom
release-plz-2026-10-06T02-38-45Z

Conversation

@github-actions

@github-actions github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

🤖 New release

  • markdown-syntax: 0.3.0 -> 0.4.0 (⚠ API breaking changes)

⚠ markdown-syntax breaking changes

--- failure constructible_struct_adds_field: struct exhaustively constructible through public API adds field ---

Description:
A pub struct that could be exhaustively constructed with a literal using only public API has a new pub field, breaking existing exhaustive literals.
        ref: https://doc.rust-lang.org/reference/expressions/struct-expr.html
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/constructible_struct_adds_field.ron

Failed in:
  field WikiLink.embed in /tmp/.tmpfYoVLv/markdown-syntax/src/ast.rs:876
  field WikiLink.embed in /tmp/.tmpfYoVLv/markdown-syntax/src/ast.rs:876
  field WikiLink.embed in /tmp/.tmpfYoVLv/markdown-syntax/src/ast.rs:876

--- failure enum_missing: pub enum removed or renamed ---

Description:
A publicly-visible enum cannot be imported by its prior path. A `pub use` may have been removed, or the enum itself may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/enum_missing.ron

Failed in:
  enum markdown_syntax::ast::AutolinkKind, previously in file /tmp/.tmpcG5za3/markdown-syntax/src/ast.rs:798
  enum markdown_syntax::prelude::AutolinkKind, previously in file /tmp/.tmpcG5za3/markdown-syntax/src/ast.rs:798
  enum markdown_syntax::AutolinkKind, previously in file /tmp/.tmpcG5za3/markdown-syntax/src/ast.rs:798

--- failure enum_no_repr_variant_discriminant_changed: enum variant had its discriminant change value ---

Description:
The enum's variant had its discriminant value change. This breaks downstream code that used its value via a numeric cast like `as isize`.
        ref: https://doc.rust-lang.org/reference/items/enumerations.html#assigning-discriminant-values
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/enum_no_repr_variant_discriminant_changed.ron

Failed in:
  variant DiagnosticCode::InvalidMdx 2 -> 3 in /tmp/.tmpfYoVLv/markdown-syntax/src/diagnostic.rs:29
  variant DiagnosticCode::StrictParse 3 -> 4 in /tmp/.tmpfYoVLv/markdown-syntax/src/diagnostic.rs:31
  variant DiagnosticCode::InvalidDocument 4 -> 5 in /tmp/.tmpfYoVLv/markdown-syntax/src/diagnostic.rs:34
  variant DiagnosticCode::InvalidMdx 2 -> 3 in /tmp/.tmpfYoVLv/markdown-syntax/src/diagnostic.rs:29
  variant DiagnosticCode::StrictParse 3 -> 4 in /tmp/.tmpfYoVLv/markdown-syntax/src/diagnostic.rs:31
  variant DiagnosticCode::InvalidDocument 4 -> 5 in /tmp/.tmpfYoVLv/markdown-syntax/src/diagnostic.rs:34
  variant DiagnosticCode::InvalidMdx 2 -> 3 in /tmp/.tmpfYoVLv/markdown-syntax/src/diagnostic.rs:29
  variant DiagnosticCode::StrictParse 3 -> 4 in /tmp/.tmpfYoVLv/markdown-syntax/src/diagnostic.rs:31
  variant DiagnosticCode::InvalidDocument 4 -> 5 in /tmp/.tmpfYoVLv/markdown-syntax/src/diagnostic.rs:34

--- failure enum_variant_added: enum variant added on exhaustive enum ---

Description:
A publicly-visible enum without #[non_exhaustive] has a new variant.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#enum-variant-new
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/enum_variant_added.ron

Failed in:
  variant SerializeError:Unrepresentable in /tmp/.tmpfYoVLv/markdown-syntax/src/serialize.rs:94
  variant SerializeError:Unrepresentable in /tmp/.tmpfYoVLv/markdown-syntax/src/serialize.rs:94
  variant SerializeError:Unrepresentable in /tmp/.tmpfYoVLv/markdown-syntax/src/serialize.rs:94

--- failure enum_variant_missing: pub enum variant removed or renamed ---

Description:
A publicly-visible enum has at least one variant that is no longer available under its prior name. It may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/enum_variant_missing.ron

Failed in:
  variant Inline::Autolink, previously in file /tmp/.tmpcG5za3/markdown-syntax/src/ast.rs:522
  variant Inline::Autolink, previously in file /tmp/.tmpcG5za3/markdown-syntax/src/ast.rs:522
  variant Inline::Autolink, previously in file /tmp/.tmpcG5za3/markdown-syntax/src/ast.rs:522

--- failure struct_missing: pub struct removed or renamed ---

Description:
A publicly-visible struct cannot be imported by its prior path. A `pub use` may have been removed, or the struct itself may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/struct_missing.ron

Failed in:
  struct markdown_syntax::ast::Autolink, previously in file /tmp/.tmpcG5za3/markdown-syntax/src/ast.rs:787
  struct markdown_syntax::prelude::Autolink, previously in file /tmp/.tmpcG5za3/markdown-syntax/src/ast.rs:787
  struct markdown_syntax::Autolink, previously in file /tmp/.tmpcG5za3/markdown-syntax/src/ast.rs:787

--- failure struct_pub_field_missing: pub struct's pub field removed or renamed ---

Description:
A publicly-visible struct has at least one public field that is no longer available under its prior name. It may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.50.0/src/lints/struct_pub_field_missing.ron

Failed in:
  field preserve_character_escapes of struct ParseOptions, previously in file /tmp/.tmpcG5za3/markdown-syntax/src/options.rs:228
  field preserve_character_references of struct ParseOptions, previously in file /tmp/.tmpcG5za3/markdown-syntax/src/options.rs:231
  field preserve_character_escapes of struct ParseOptions, previously in file /tmp/.tmpcG5za3/markdown-syntax/src/options.rs:228
  field preserve_character_references of struct ParseOptions, previously in file /tmp/.tmpcG5za3/markdown-syntax/src/options.rs:231
  field preserve_character_escapes of struct ParseOptions, previously in file /tmp/.tmpcG5za3/markdown-syntax/src/options.rs:228
  field preserve_character_references of struct ParseOptions, previously in file /tmp/.tmpcG5za3/markdown-syntax/src/options.rs:231
Changelog

0.4.0 - 2026-10-06

Added

  • [breaking] rebuild block parsing and serializer escaping on one source of syntax rules (#15)

Fixed

  • map spans to their source and fix CommonMark parse and round-trip defects (#12)

Migration

This release changes the AST, the parse of block structure, and the
serializer's output. Code that matches on the AST or compares canonical
output needs these updates.

  • Autolinks are links. Inline::Autolink and AutolinkKind are removed.
    Literal autolinks (https://a.b, www.a.b, a@b.c), angle-bracket
    autolinks (<https://a.b>), and links whose text equals their URL are all
    Link nodes whose one child is a Text holding the URL as written. Such a
    link is written <url> when that reads back, and [text](url) otherwise
    (www.a.b → [www.a.b](http://www.a.b)).
  • Escapes and character references are always nodes.
    ParseOptions::preserve_character_escapes and
    ParseOptions::preserve_character_references are removed: the parser
    always produces Inline::Escape and Inline::CharacterReference, and the
    serializer writes them as recorded. In a table cell, \| is an
    Escape('|') in text and | inside a raw-text construct.
  • Wiki embeds. WikiLink gains embed: bool: ![[x]] is an embed and
    \![[x]] is an escaped ! before a plain wiki link. The HTML renderer
    marks an embed with data-wikilink-embed="true".
  • Shortcodes come from gemoji. A shortcode needs a name in the pinned
    github/gemoji v4.1.0 table and no letter or digit directly outside either
    colon, so clock times and a:b:c stay text. A :word: outside the table
    stays text too: a text directive's name followed by a : opens no
    directive. Shortcode::glyph() returns the emoji, validation rejects a
    name outside the table, and the HTML renderer writes the glyph.
  • Serialization reads its output back. SerializeOptions gains
    syntax: SyntaxOptions, the dialect the output is read back under (the
    maximal dialect by default). Set it to the preset you parse with: a
    CommonMark parse of a ==b== c otherwise writes a \=\=b\=\= c, since
    the maximal dialect reads == as highlight.
    SerializeError::Unrepresentable is returned, with
    DiagnosticCode::Unrepresentable, when no Markdown the serializer can
    write reads back as the same tree; an exhaustive match on
    SerializeError needs an arm for it.
  • New diagnostic codes. DiagnosticCode::InvalidDirectiveAttribute
    warns about a directive attribute without a valid name, which is dropped;
    DiagnosticCode::Unrepresentable names the node serialization cannot
    write.
  • Canonical output changes. Only what a parse reads as syntax is
    escaped:
    • an unpaired delimiter stays raw (x_y_, not x_y\_);
    • a pipe ending a setext heading stays raw (a |, not a \|);
    • brackets that form no reference stay raw ([x] when nothing defines
      x);
    • a delimiter run the parse uses is escaped whole (\=\=a\=\=);
    • emphasis and strong take * unless that does not read back
      (***(a b)\_.***\*#, was _**(a b)\_.**_\*#);
    • an invalid character reference such as &unknown; stays raw;
    • a nested list is indented only when the block after it would join its
      last item, and a list marker override yields where two adjacent lists
      would read as one.
  • Block structure follows CommonMark's algorithm. Block quotes, list
    items, container directives, footnote definitions, HTML containers,
    description details, and alerts are read in one pass over a stack of open
    blocks, matching commonmark.js on the cases Rebuild block parsing and serializer escaping on one source of rules, and fold autolinks into Link #11
    lists. A task item's checkbox is part of its marker, so its paragraph
    starts after it. ::name text is a paragraph; a leaf directive stands alone
    on its line.
  • Block parse changes that move the AST of existing input:
    • footnote definitions, directive openers, math fences, and description
      details open only up to three columns in;
    • a container directive's closing fence closes the innermost open one,
      and its last child's span ends after its line ending;
    • footnote definitions and alert paragraphs take lazy continuation lines;
    • tabs after a tab split by a container prefix keep their columns;
    • blank lines inside a fence or HTML block do not loosen a list;
    • an unclosed fence keeps its trailing blank lines;
    • a multi-line definition title drops its continuation lines'
      indentation;
    • an alert's marker line keeps a following indented line from starting
      indented code, as a paragraph line does.
  • Literal autolinks end earlier. A literal or relaxed-scheme autolink
    ends at Unicode whitespace, <, a non-ASCII punctuation or symbol char
    (,, 。, 、), or, with wikilinks on, [[. parse no longer panics on
    a no-break space before an email-like run.
  • A _ run gets no strikethrough bonus beside a ~: d_~_ is text.


This PR was generated with release-plz.

@github-actions github-actions Bot changed the title chore: release v0.3.1 chore: release v0.4.0 Oct 6, 2026
@github-actions
github-actions Bot force-pushed the release-plz-2026-10-06T02-38-45Z branch from 7dcc39c to 52370a8 Compare October 6, 2026 16:19
@plimeor plimeor closed this Oct 6, 2026
@plimeor
plimeor deleted the release-plz-2026-10-06T02-38-45Z branch October 8, 2026 03:28
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.

1 participant