-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
fix: Ignore emoji shorthand codes in URIs #1847
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 62069de:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for submitting the PR, @socsieng.
There is a much easier fix: simply add a
to the existing list of tags that are being marked:
docsify/src/core/render/emojify.js
Lines 31 to 35 in 682bf96
// Mark colons in tags | |
.replace( | |
/<(code|pre|script|template)[^>]*?>[\s\S]+?<\/(code|pre|script|template)>/g, | |
m => m.replace(/:/g, '__colon__') | |
) |
Change this line:
docsify/src/core/render/emojify.js
Line 33 in 682bf96
/<(code|pre|script|template)[^>]*?>[\s\S]+?<\/(code|pre|script|template)>/g, |
To this:
/<(a|code|pre|script|template)[^>]*?>[\s\S]+?<\/(a|code|pre|script|template)>/g,
This fix also addresses an issue with the regex you were using in your initial PR.
Wouldn't marking the |
Examples: - Without explicit scheme (i.e. starting with `//`) - In single and double quote strings - Within unquoted HTML tag attributes - In css `url()` values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks again, @socsieng.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you!
Any ideas about when these changes will be available in npm? |
Not sure when npm will be released. But you can try https://github.com/sy-records/docsify-nightly |
You can also try installing from github using npm install "docsify@docsifyjs/docsify#develop" Or to install from a commit: npm install "docsify@docsifyjs/docsify#3c9b3d9702bb05a5ff45a4ce4233e144cf1ebecb" Or any git ref: npm install "docsify@docsifyjs/docsify#<GIT_REF_GOES_HERE>" which can be a tag, branch, etc. |
Thanks. Appreciate the help. I was more wondering what the timelines were to determine if I should wait for a formal package update or if I should use a github based version. |
@socsieng -- I think we're close to pushing an update. There's one other PR that I'd like to see merged before we do so, but otherwise I don't think anyone would have an issue pushing a new minor or patch release (have to check history to determine which would be appropriate). I'll see if I can wrap that up today or tomorrow. |
Fixes: #1823,
Fixes: #1839
Summary
Fixes an issue related to unintentional processing of emoji shorthand codes when included in a URI
What kind of change does this PR introduce?
Bugfix
For any code change,
Does this PR introduce a breaking change? (check one)
If yes, please describe the impact and migration path for existing applications:
Related issue, if any:
Tested in the following browsers:
Using: https://codesandbox.io/s/thirsty-fog-inwfl8