Repository navigation
Conversation
Contributor
Owner
|
Thank you for this PR. I think this fits better as a separate package or plugin than as part of markdown-exit. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'm moving the Chat SDK from remark to Comark, which parses with markdown-exit. Messages lose
www.example.comlinks, because linkify-it 6 doesn't link them and remark-gfm did. linkify-it also adds 3.1 KiB gzip tomarkdown-exit/core.This PR adds
markdown-exit/linkify-gfm, a plugin that links with GitHub's rules (GFM autolinks) and doesn't use linkify-it. The default entry doesn't change.core+ linkifier, KiB gzipThe miss is
ftp://, which remark-gfm skips too. linkify-it'sfuzzyLink: truegets 8 / 11, but it also links bare domains likeexample.com. With #47, nothing importsuc.microanymore, so the two PRs save more together. Render speed is the same on chat messages and up to 1.4x faster on link-heavy text.It has no TLD list or custom schemas, so
md.linkify.tlds()andadd()throw. Inline markdown still parses first, sowww.example.com/a*b*clinks only up to/a.The rules are a port of remark-gfm's autolink code. I first wrote them in onmax/tiny, where a fuzzer found 0 differences from remark-gfm on about 70,000 lines, and this port matches that code on 300,000 fuzzed inputs.
Related: #41, #47