Skip to content
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

git-svn(zh_HANS-CN): avoid bogus file:// link #106

Merged
merged 1 commit into from
May 11, 2024

Conversation

dscho
Copy link
Contributor

@dscho dscho commented May 11, 2024

The way the description is currently written, there is no space after the file:// in the translation, even if there is a space there in the original.

This is important because the way AsciiDoc is parsed, a missing space will mistake the text for being an actual hyperlink, see e.g. here. At the time of writing, this bogus link can be experienced on Git's home page:

image

However, the "domain name" is quite bogus seeing as it reads, according to Bing Translate:

access), but want to publish in metadata with public

which is obviously not a valid domain name.

Firefox is smart enough to realize that this is not a valid domain name, and "auto-fixes" it to file:///. However, Edge (and therefore most likely Chrome, too), as well as link checkers such as Lychee translate this into an internationalized domain name starting with the "ASCII-Compatible Encoding" prefix "xn--" which is immediately followed by a closing parenthesis, i.e. an invalid character in internet host/domain names, but at least Lychee tries to follow it nevertheless:

file://xn--),-ry2c56bzyech9a071b11ispsycrp191dutgptg8hx808c0kpb/

Let's clearly separate file:// from the next word and avoid letting AsciiDoc mark this as a hyperlink.

The way the description is currently written, there is no space after
the `file://` in the translation, even if there is a space there in the
original.

This is important because the way AsciiDoc is parsed, a missing space
will mistake the text for being an actual hyperlink, see e.g.:

https://github.com/jnavila/git-html-l10n/blob/171352a71363/zh_HANS-CN/git-svn.html#L1198

At the time of writing, this bogus link can be experienced here:

https://git-scm.com/docs/git-svn/zh_HANS-CN#git-svn-svn-remoteltgtrewriteRoot

However, the "domain name" is quite bogus seeing as it reads, according
to Bing Translate:

	access), but want to publish in metadata with public

which is obviously not a valid domain name.

Firefox is smart enough to realize that this is not a valid domain name,
and "auto-fixes" it to `file:///`. However, Edge (and therefore most
likely Chrome, too), as well as link checkers such as Lychee
(https://lychee.cli.rs/) translate this into an internationalized
domain name starting with the "ASCII-Compatible Encoding" prefix "xn--"
(see https://en.wikipedia.org/wiki/Internationalized_domain_name) and is
immediately followed by a closing parenthesis, which is not a valid
character in internet host/domain names, but at least Lychee tries to
follow it nevertheless:

file://xn--),-ry2c56bzyech9a071b11ispsycrp191dutgptg8hx808c0kpb/

Let's clearly separate `file://` from the next word and avoid letting
AsciiDoc mark this as a hyperlink.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@jnavila
Copy link
Owner

jnavila commented May 11, 2024

Thanks for the report. The checks need to be muscled on this kind of issues...

@jnavila jnavila merged commit a3a0496 into jnavila:master May 11, 2024
1 check passed
@dscho dscho deleted the fix-bogus-link branch May 13, 2024 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants