Skip to content

Formatting failure for long link included in a bulleted list #49

@AlexWaygood

Description

@AlexWaygood

This seems quite oddly specific, but I haven't been able to narrow it down any further. mdformat fails to format a Markdown file with the following content if mdformat-mkdocs is installed:

- a https://github.com/python/mypy/blob/a3ce6d5307e99a1b6c181eaa7c5cf134c53b7d/test-data/check-protocols
- b

(That link doesn't actually take you anywhere; I removed characters from the original link in my Markdown file to create a minimal repro. Removing any more characters from the link seems to mean that the issue no longer reproduces, which makes me think it's probably a line-length issue of some kind...?)

The error message I encountered is:

Error: Could not format
"/Users/alexw/dev/ruff/crates/red_knot_python_semantic/resources/mdtest/protocols.md".

Formatted Markdown renders to different HTML than input Markdown. This is a bug
in mdformat or one of its installed plugins. Please retry without any plugins
installed. If this error persists, report an issue including the input Markdown
on https://github.com/hukkin/mdformat/issues. If not, report an issue on the
malfunctioning plugin's issue tracker.

The error occurs if mdformat-mkdocs is the sole plugin installed, and does not occur if no plugins are installed, so I think this is an issue with mdformat-mkdocs.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions