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

Update make_rst.py for non-latin texts #56119

Merged
merged 1 commit into from
Dec 21, 2021

Conversation

timothyqiu
Copy link
Member

@timothyqiu timothyqiu commented Dec 21, 2021

Follow-up of #55930.

  • Inserts backslash-escaped whitespace according to reStructedText inline markup recognition rules.
    • This is required to correctly generate RST markups for some languages like Chinese. Spaces are not used between characters, and non-latin punctuations are used. For example:
      • [b]注意:[/b][code]param[/code] 是必须的。
      • 请参阅[url=https://example.com]某某网站[/url]查看最新内容。
    • It's claimed in the rules that similar non-ASCII punctuation characters are allowed as markup precedent and subsequent. But in practice it's quite unreliable, so I just ignored it and didn't add them as precedent and subsequent. (The reason might be that RST uses a fixed Unicode version, and character categories changed in later Unicode versions. But it's un-important anyway, using that only complicates code I think.)
  • indent_level was not taken into account when offseting pos after stripping indents, so some codeblocks may be skipped if the next line is too short. (This happens sometimes after translated into Chinese)

@timothyqiu timothyqiu requested a review from a team as a code owner December 21, 2021 08:53
@akien-mga akien-mga added this to the 4.0 milestone Dec 21, 2021
@akien-mga akien-mga merged commit d321858 into godotengine:master Dec 21, 2021
@akien-mga
Copy link
Member

Thanks!

@timothyqiu timothyqiu deleted the make-rst branch December 21, 2021 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants