-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Fix the links for non-English alphabets when anchors generated #2028
Merged
Conversation
This file contains 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
ghost
requested a review
from ZYSzys
February 3, 2019 02:51
@nodejs/nodejs-cn:Please have a review for that. |
ghost
requested a review
from fhemberger
February 3, 2019 02:54
ghost
changed the title
Fix: Fix the links for non-English alphabets when anchors generated
zh-CN:Fix the links for non-English alphabets when anchors generated
Feb 3, 2019
ghost
mentioned this pull request
Feb 3, 2019
Consider that some special characters (not included in the 26 English alphabets) are ignored by md file's anchor when generated. We have to change the anchor link. Take this as an example:'SmartOS 和 illumos', the '和' doesn't belong to an English character, so it's ignored and the generated anchor would be '#smartos-illumos' instead of '#smartos-and-illumos'. This is the HOT fix for that. What I did now is to use the pure HTML instead of md's "##" to force the "a href"'s link to keep it the same as that in English version.
@nodejs/localization:Kindly tip, please notice whether your own specific language has the same problem :) |
ghost
changed the title
zh-CN:Fix the links for non-English alphabets when anchors generated
Fix the links for non-English alphabets when anchors generated
Feb 3, 2019
ghost
merged this pull request
into
nodejs:master
Feb 3, 2019
ghost
deleted the
FixAnchorErr
branch
February 3, 2019 08:45
Did these commits disappear from master? The commits of #2026 are also gone. |
I don't see the images, they only show |
ghost
mentioned this pull request
Feb 3, 2019
ghost
pushed a commit
that referenced
this pull request
Feb 3, 2019
@yous:No problem, I've re-submitted and everything goes fine ! |
ghost
mentioned this pull request
Feb 7, 2019
Merged
ghost
pushed a commit
that referenced
this pull request
Feb 7, 2019
The Non-English characters WON'T be generated in the anchor link, so this is the HOT fixture for that. Ref: #2028.
This was referenced Feb 8, 2019
fhemberger
pushed a commit
that referenced
this pull request
Feb 9, 2019
* Fix: Fix for the non-English character generation of Anchor Link I. In the recent days we've fixed the non-English character generation of anchor link by directly using the pure HTML tags, however a better way is: 1) Check whether the current title has the comment symbol (<!---->). 2) If yes, just take the characters out of the symbol as the anchor link's name, with the real text as the title behind it. 3) If not, just do replacements as what it used to be. The advantage is that you can keep the anchor link the same as what it is in the English version or define by yourself. What's more: It's much more flexible when your change the level of titles, compared with #2028. II. Add '--fix' for local test to automatically fix some simple formation typo errors. * fix_comment
This pull request was closed.
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.
Consider that some special characters (not included in the 26 English alphabets) are ignored by md file's anchor when generated. We have to change the anchor link.
Take this as an example:'SmartOS 和 illumos', the '和' doesn't belong to an English character, so it's ignored and the generated anchor would be '#smartos-illumos' instead of '#smartos-and-illumos'.
This is the HOT fix for that. What I did now is to use the pure HTML instead of md's "##" to force the "a href"'s link to keep it the same as that in English version.
PS:For Japanese, it seems they've noticed the anchor problem so their anchor name isn't the same as the English version. What I do is just to change the title to make it the same as what we can see in the category.
【Before Fix】