Commit 749b4c2
i18n/potool: fix inline-markup whitespace-inside-delimiter boundary case
cjk_pad already separates markup from any non-whitespace neighbour (CJK,
non-ASCII letters suffixed to a role, ASCII openers after a literal). It did
NOT handle whitespace sitting immediately inside a delimiter -- e.g. a
translator's `**) **` from restructured nested bold -- which docutils rejects
as "start-string without end-string" yet _INLINE_RE matched as a valid span,
so it slipped past both cjk_pad and the markup-invariant gate.
Add _trim_inner_ws (called from cjk_pad): relocate leading/trailing whitespace
from just inside ``literal``/**strong**/*emphasis* delimiters to just outside,
collapsing into any adjacent whitespace so no double space is introduced.
Visible text is unchanged; the markup now parses. Verified against docutils
(broken -> 1 warning, fixed -> 0) and idempotent.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 68e0506 commit 749b4c2
1 file changed
Lines changed: 56 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
72 | 115 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
77 | 129 | | |
78 | 130 | | |
79 | 131 | | |
| |||
0 commit comments