Repository navigation
fix(markdown): prevent double encoding of GFM autolink URLs - #40
Conversation
PR HealthPublish ✔️
Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation. This check can be disabled by tagging the PR with Changelog Entry ✔️
Changes to files need to be accounted for in their respective changelogs. This check can be disabled by tagging the PR with Breaking changes ✔️
This check can be disabled by tagging the PR with API leaks ✔️The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.
This check can be disabled by tagging the PR with Unused Dependencies ✔️
For details on how to fix these, see dependency_validator. This check can be disabled by tagging the PR with License Headers ✔️
All source files should start with a license header. Unrelated files missing license headers
This check can be disabled by tagging the PR with Coverage ✔️
This check for test coverage is informational (issues shown here will not fail the PR). This check can be disabled by tagging the PR with |
f6466d1 to
3793f0c
Compare
3793f0c to
5f8df5e
Compare
Bug
GFM extended URL autolinks use
Uri.encodeFullon the whole destination, which escapes%itself, sohttps://example.com/%40foogetshref=".../%2540foo". See dart-lang#2479 and dart-lang#2169.Change
%XXescapes and encode only the rest of the destination, asnormalizeLinkDestinationalready does for inline links (CommonMark example 502).%still go straight toUri.encodeFull.%zz->%25zz).test/extensions/autolink_extension.unit.Otzaria impact
Bare URLs in imported Markdown that already contain percent escapes (e.g. Hebrew Wikipedia links) now link to the right destination.
QA
format/analyze/test pass locally (Dart 3.13). Differential vs main over the spec inputs, all pub-cache README/CHANGELOG files, Hebrew samples and 20k fuzz inputs: the only differences are
%25XX->%XXinside autolink hrefs.