Repository navigation
Conversation
Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
|
@hakarrr is attempting to deploy a commit to the MarkedJS Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
UziTech
left a comment
There was a problem hiding this comment.
Let's just keep the GFM tests since that is all that are affected by autolink
Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
|
Thanks, done. I removed the CommonMark and pedantic fixture pairs and kept only the GFM fixture, which is unchanged. The URI autolink unit tests now run in GFM mode only, with the same ten Unicode separators and eight ASCII space/control inputs. Production code is unchanged. Locally the full suite passes with 2,037 specs and 258 unit tests, down from 2,041 specs because of the four deleted fixtures. I also updated the PR description to match. |
There was a problem hiding this comment.
please use new spec tests instead of unit tests
The uri_autolink_unicode_whitespace_gfm spec fixture already covers the Unicode whitespace cases and the ASCII space and control character rejections, so the unit tests only repeat it. Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
|
Thanks. I dropped the unit tests in 239c8cf. The GFM spec fixture is now the only test for this change. |
239c8cf to
c0c973e
Compare
Marked version: master (
c6b22e89)Markdown flavor: CommonMark, GFM and pedantic
Description
CommonMark 6.5 defines an angle URI autolink as a scheme and colon followed by characters other than ASCII controls, ASCII space and angle brackets. The current
\sexclusion also rejects nonbreaking spaces and other Unicode whitespace that the rule allows.Replace that broad whitespace exclusion with ASCII space. For example, an angle URI containing a literal NBSP now produces a link with the original label and a percent-encoded destination. Email and bare URL recognition are unchanged. The shared autolink rule intentionally changes pedantic mode too.
Validate masking candidates against the original source rather than escape placeholders. Otherwise, a backslash-escaped closing angle can make the mask extend past the real autolink and hide an emphasis closer. This support fix is included here independently of the same original-byte validation in unmerged #4242; this PR does not require #4242.
Demo: master / CommonMark.
Tests
npm test: 2,037 spec tests and 258 unit tests pass, plus UMD, CJS, types and lint.npm run build:resetandgit diff --checkpass.These are bounded probes, not full conformance claims. Comparison normalization decodes HTML entities and collapses whitespace. Existing unrelated Unicode line-separator emphasis behavior is not fixed here. The exact fixtures retain Marked's existing image-tag style and pedantic tab expansion.
Contributor
Committer