Skip to content

feat: migrate to mistune 3.x API - #18

Merged
geopanther merged 7 commits into
mainfrom
feat/update-mistune-api
May 7, 2026
Merged

feat: migrate to mistune 3.x API#18
geopanther merged 7 commits into
mainfrom
feat/update-mistune-api

Conversation

@geopanther

Copy link
Copy Markdown
Owner

Summary

Migrates from legacy mistune 0.x API to mistune 3.x, fixing Dependabot PR #16 incompatibility.

Changes

  • Dependency: mistune>=0.8.4,<1mistune>=3.0,<4
  • Renderer: mistune.Renderermistune.HTMLRenderer(escape=False)
  • Method signatures: header()heading(), reordered link(text, url, title) / image(text, url, title), langinfo
  • Utilities: mistune.escape_linkmistune.escape_url
  • Parsing: mistune.Markdown(renderer=...) with typed result narrowing
  • Tests: Updated all 20+ renderer test calls, regenerated functional test result.xml
  • Docs: Updated README code example

BREAKING CHANGE

Requires mistune >=3.0 (drops 0.x support). No user-facing API changes.

Tests

  • 126 unit tests pass
  • tox py312 + py313 pass
  • All pre-commit + pre-push hooks pass
  • ty reports zero errors

Supersedes Dependabot PR #16.

BREAKING CHANGE: requires mistune >=3.0,<4 (drops mistune 0.x support)

- Replace mistune.Renderer with mistune.HTMLRenderer (escape=False)
- Rename header() to heading(), update link/image/block_code signatures
- Replace mistune.escape_link with mistune.escape_url
- Use mistune.Markdown directly with typed result narrowing
- Regenerate functional test result.xml for v3 output
- Update README code example
Required for plugin API used in upcoming rendering features.
Enable table, strikethrough, mark, insert, superscript, subscript,
footnotes, def_list, abbr, math, spoiler, task_lists, and url plugins.
Mistune 3.x ships with all plugins disabled by default.

Add Confluence-specific overrides: XHTML-compliant task list attributes,
anchor macros for footnotes, and mathinline/mathblock/enablelatexmath
macros for LaTeX math rendering.
Parametrized unit tests for all 13 enabled mistune plugins.
Functional test markdown demonstrating all plugin features.
Add table listing all 13 enabled Mistune plugins with syntax examples.
Note that math rendering requires the LaTeX Math - MathJax Confluence
plugin and that enablelatexmath is auto-injected when math is detected.
Update library usage example to show plugin activation.
Confluence strips <abbr> and <mark> HTML5 tags, content degrades to
plain text. Spoiler div has no native visual effect. Add warnings to
plugin table in README.
@geopanther
geopanther merged commit ae40125 into main May 7, 2026
5 checks passed
@geopanther
geopanther deleted the feat/update-mistune-api branch May 7, 2026 14:58
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