Skip to content

Commit 6e69b7f

Browse files
committed
docs(zh_HANS-CN): a trailing "full stop" character is not part of a URL
When encountering a bare URL, AsciiDoc helpfully renders it as a link. In English, when encountering a bare URL at the end of a sentence, AsciiDoc is smart enough not to include the full stop character (`.`) that comes after the URL. In other languages, other full stop characters exist, and AsciiDoc apparently does not know the special meaning of `。` mistaking it for being part of the bare URL. Let's work around that. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent f1dcee8 commit 6e69b7f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

script/update-docs.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ def index_l10n_doc(filter_tags, doc_list, get_content)
143143
relurl = "docs/#{x[1].gsub(/&#x2d;/, '-')}/#{lang}"
144144
"<a href='{{< relurl \"#{relurl}\" >}}'>#{x[1]}[#{x[2]}]</a>"
145145
end
146+
# Handle Chinese "full stop" character
147+
html.gsub!(/(<a href="[^"]*)。(")/, "\\1\\2")
148+
html.gsub!(/( class="bare">[^<]*)(。)(<\/a>)/, "\\1\\3\\2")
149+
146150
# HTML anchor on hdlist1 (i.e. command options)
147151
html.gsub!(/<dt class="hdlist1">(.*?)<\/dt>/) do |_m|
148152
text = $1.tr("^A-Za-z0-9-", "")

0 commit comments

Comments
 (0)