-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug fix: Prevent fully defined links [name
](link) from being reformatted
#10442
Conversation
name
](link) from being reformattedname
](link) from being reformatted
name
](link) from being reformattedname\
](link) from being reformatted
name\
](link) from being reformattedname
](link) from being reformatted
55c5573
to
de0a6ec
Compare
|
Does the example in https://docs.astral.sh/ruff/rules/typed-argument-default-in-stub/ now render correctly? I think this hack exists because MkDocs wasn't respecting backticks within URLs. |
It does work. Although looking again at #280 I'm not sure why. |
Is it possible that something changed in MkDocs? |
Wait actually this always worked even in Python-Markdown/markdown#280
|
What doesn't work is empty references with code formatting, so the proposed fix is reasonable.
And actually the current implementation doesn't address Python-Markdown/markdown#280 |
Oh right, I think the motivating case was specifically about reference links. |
Summary
Currently fully define markdown links which include ticks are being reformatted by
ruff/crates/ruff_dev/src/generate_docs.rs
Lines 105 to 114 in 8619986
[`name`](link)
->[`name`][name](link)
For example: https://docs.astral.sh/ruff/rules/typed-argument-default-in-stub/
This PR excludes the open parentheses from the regex, so that these types of links won't be reformatted.
Test Plan
Extended the regression test.