Skip to content

Fix link patterns inside wrapped Markdown labels - #747

Open
nk-batman21 wants to merge 1 commit into
trentm:masterfrom
nk-batman21:fix-multiline-link-patterns
Open

nk-batman21 wants to merge 1 commit into
trentm:masterfrom
nk-batman21:fix-multiline-link-patterns

Conversation

@nk-batman21

Copy link
Copy Markdown

With link-patterns enabled, a wrapped Markdown link label can gain a nested anchor. An image with a wrapped alt label can instead display escaped anchor markup in its alt text.

Let the existing inline-link exclusion span label newlines, bounded by the core link parser's label limit. Extend the Markdown syntax fixture with wrapped links, images, nested brackets, and automatic links before and after them.

  • Ran: full native test suite, 296 tests on Python 3.9, 3.13, and 3.14 with all optional dependencies.
  • Ran: python test/test_redos.py, 12 tests.
  • Checked: new fixture fails before the fix; 168 link/image comparisons and changed-line PEP8 pass.

@Crozzers Crozzers left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changelog also needs updating

Comment thread README.md
than once.

The `link-patterns` extra leaves inline Markdown links and images unchanged,
including when their labels wrap onto another line.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't explain anything about what the extra actually does, just tells us something it doesn't do.

Not needed here - should go in the wiki page for the extra instead after this is merged

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.

2 participants