You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 57627b2
Browse filesBrowse the repository at this point in the historyBrowse files
authored
fix(translate): stop a sentence's punctuation from being read as part of a URL (#360)
`translation-url-residue` matched `\S+` after a scheme — everything up to the
next space. A scheme with nothing after it therefore became a URL, so the
English prose `(https://)` yielded `https://)`; and Chinese does not write
spaces, so on the translation side the match ran past the address and took the
rest of the sentence with it, `(https://)和路径` yielding `https://)和路径`.
The two sides could not agree no matter how faithful the translation was.
Measured: `connectors-operator` release-1.14 was red on every docs build for 22
hours — 9 runs — on one line reading `includes the correct protocol (https://)
and path`. Nothing had been lost. The rule's own note said a check that
misfires costs "one finding to read"; it does not. This rule reports against
the whole page, so the assembled document could not attribute the finding to a
segment and failed outright, no repair round, blast radius the whole page.
- a URL now ends at the first character a URL cannot contain (printable ASCII),
not at the next space, so both languages agree where it ends. The letters are
spelled out rather than left to an `i` flag on purpose: under `iu` the engine
case-folds first, and `s`/`k` fold to `ſ`/`K`, which `\P{ASCII}` would then
swallow — caught by the one test with an `s` mid-URL;
- trailing punctuation comes off the way GFM's autolink extension takes it off,
and a closing bracket only when the URL did not open it;
- a scheme with no host is not a URL.
And the backstop: `translation-url-residue` is now checked per segment during
acceptance too, as `translation-heading-sequence`,
`translation-component-multiset` and `no-unparsed-emphasis` already are. A
whole-document finding names a defect but not a place, so it had no segment to
be sent back to and could only fail the document; checked per segment it
arrives with the segment attached and is simply retranslated.
Eight of the ten `translation-*` rules still have no per-segment mirror and all
report against the document root, so any of them firing at assembly time fails
the page the same way. Left as it is, and written down.
Claude-Session: https://claude.ai/code/session_01XrrxNMokh3mx56riYUDnbQ
Co-authored-by: ysyou <xiaodongzhang2026@gmail.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
0 commit comments