Skip to content

Commit d2c7722

Browse files
authored
[69_8] Fix quotes for line start and line end rules in Chinese
1 parent 9ceac4a commit d2c7722

File tree

3 files changed

+258
-12
lines changed

3 files changed

+258
-12
lines changed

TeXmacs/tests/66_13.scm

+9
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
(check (herk->utf8 (string #\x0A)) => "˙") ; U+02D9
2020
(check (herk->utf8 (string #\x0B)) => "¸") ; U+00B8
2121
(check (herk->utf8 (string #\x0C)) => "˛") ; U+02DB
22+
2223
(check (herk->utf8 (string #\x0D)) => "") ; U+201A
24+
(check (utf8->herk "") => (string #\x0D)) ; U+201A
25+
2326
(check (herk->utf8 (string #\x0E)) => "") ; U+2039
2427
(check (herk->utf8 (string #\x0F)) => "") ; U+203A
2528

@@ -52,7 +55,11 @@
5255

5356
(define (test-herk-1x)
5457
(check (herk->utf8 (string #\x10)) => "") ; U+201C
58+
(check (utf8->herk "") => (string #\x10))
59+
5560
(check (herk->utf8 (string #\x11)) => "") ; U+201D
61+
(check (utf8->herk "") => (string #\x11)) ; U+201D
62+
5663
(check (herk->utf8 (string #\x12)) => "") ; U+201E
5764
(check (herk->utf8 (string #\x13)) => "«") ; U+00AB
5865
(check (herk->utf8 (string #\x14)) => "»") ; U+00BB
@@ -166,6 +173,8 @@
166173

167174
(define (test-herk-6x)
168175
(check (herk->utf8 (string #\x60)) => "")
176+
(check (utf8->herk "") => (string #\x60))
177+
169178
(check (herk->utf8 (string #\x61)) => "a")
170179
(check (herk->utf8 (string #\x62)) => "b")
171180
(check (herk->utf8 (string #\x63)) => "c")

TeXmacs/tests/tmu/69_8.tmu

+239
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,239 @@
1+
<TMU|<tuple|1.0.5|1.2.9.6>>
2+
3+
<style|<tuple|generic|chinese>>
4+
5+
<\body>
6+
<section|Bug Metadata>
7+
8+
<\itemize>
9+
<item>Reporter: Rui Zhang
10+
11+
<item>Mogan Editor Version: v1.1.1
12+
13+
<item>Issue: <slink|https://github.com/XmacsLabs/mogan/issues/397>
14+
</itemize>
15+
16+
<section|Description>
17+
18+
<with|language|chinese|<tabular|<tformat|<cwith|1|1|1|1|cell-hyphen|t>|<cwith|1|1|2|2|cell-hyphen|t>|<cwith|1|1|1|1|cell-width|60pt>|<cwith|1|1|1|1|cell-hmode|exact>|<cwith|1|1|3|3|cell-width|60pt>|<cwith|1|1|3|3|cell-hmode|exact>|<cwith|1|1|3|3|cell-hyphen|t>|<cwith|1|1|2|2|cell-width|55pt>|<cwith|1|1|2|2|cell-hmode|exact>|<table|<row|<\cell>
19+
我能吞下(玻璃)而不伤身体。
20+
</cell>|<\cell>
21+
我能吞下“玻璃”而不伤身体。
22+
</cell>|<\cell>
23+
我能吞下【玻璃】而不伤身体。
24+
</cell>>>>>>
25+
26+
\;
27+
28+
Problems:
29+
30+
<\itemize>
31+
<item>Punctuations like “, ( and 【 should not be allowed at the end of a line.
32+
33+
<item>Punctuations like ”, ) and 】 should not be allowed at the beginning of a line.
34+
</itemize>
35+
36+
<subsection|Line break is prohibited between CJK if either is enclosed in an environment><\footnote>
37+
See <slink|https://github.com/XmacsLabs/mogan/issues/398>
38+
</footnote>
39+
40+
<tabular|<tformat|<cwith|2|2|1|1|cell-hyphen|t>|<cwith|2|2|1|1|cell-width|70pt>|<cwith|2|2|1|1|cell-hmode|exact>|<cwith|2|2|2|2|cell-hyphen|t>|<cwith|1|-1|2|2|cell-width|75pt>|<cwith|1|-1|2|2|cell-hmode|exact>|<cwith|2|2|3|3|cell-hyphen|t>|<cwith|1|-1|3|3|cell-width|80pt>|<cwith|1|-1|3|3|cell-hmode|exact>|<table|<row|<cell|70pt>|<cell|75pt>|<cell|80pt>>|<row|<\cell>
41+
我能吞下玻璃而不伤身体。
42+
43+
我能吞下玻璃而<with|font-series|bold|不伤>身体。
44+
45+
我能吞下玻璃而<line-break><with|font-series|bold|不伤>身体。
46+
</cell>|<\cell>
47+
我能吞下玻璃而不伤身体。
48+
49+
我能吞下玻璃而<with|font-series|bold|不伤>身体。
50+
51+
我能吞下玻璃而<line-break><with|font-series|bold|不伤>身体。
52+
</cell>|<\cell>
53+
我能吞下玻璃而不伤身体。
54+
55+
我能吞下玻璃而<with|font-series|bold|不伤>身体。
56+
57+
我能吞下玻璃而<line-break><with|font-series|bold|不伤>身体。
58+
</cell>>>>>
59+
60+
<section|Prohibition Rules for Line Start and Line End>
61+
62+
<\quote-env>
63+
Pause or stop punctuation marks (secondary commas, commas, semicolons, colons, periods, exclamation marks, and question marks), closing quotation marks, closing parentheses, closing angle brackets, connector marks, and interpuncts should not appear at the line start. Opening quotation marks, opening parentheses, and opening angle brackets should not appear at the line end. This is the most recommended method.<\footnote>
64+
See <slink|https://www.w3.org/International/clreq/#prohibition_rules_for_line_start_end>
65+
</footnote>
66+
</quote-env>
67+
68+
<paragraph|For line start>
69+
70+
<tabular*|<tformat|<table|<row|<cell|顿号>|<cell|逗号>|<cell|句号>|<cell|冒号>|<cell|分号>|<cell|叹号>|<cell|问号>>|<row|<cell|、>|<cell|,>|<cell|。>|<cell|:>|<cell|;>|<cell|!>|<cell|?>>>>>
71+
72+
<tabular|<tformat|<twith|table-halign|l>|<cwith|1|-1|1|-1|cell-halign|c>|<table|<row|<cell|连接号>|<cell|间隔号>|<cell|分隔号>>|<row|<cell|<subtable|<tformat|<table|<row|<cell|—>|<cell|->|<cell|~>>>>>>|<cell|\<centerdot\>>|<cell|/>>>>>
73+
74+
<tabular|<tformat|<cwith|2|2|1|1|cell-halign|c>|<cwith|1|1|2|2|cell-halign|r>|<cwith|1|1|3|3|cell-halign|r>|<cwith|1|1|1|-1|cell-tborder|0ln>|<cwith|1|1|1|-1|cell-bborder|1ln>|<cwith|2|2|1|-1|cell-tborder|1ln>|<cwith|1|1|1|1|cell-lborder|0ln>|<cwith|1|1|3|3|cell-rborder|0ln>|<cwith|1|1|2|2|cell-tborder|0ln>|<cwith|2|2|2|2|cell-bborder|0ln>|<cwith|1|-1|2|2|cell-lborder|1ln>|<cwith|1|-1|1|1|cell-rborder|1ln>|<cwith|1|-1|2|2|cell-rborder|1ln>|<cwith|1|-1|3|3|cell-lborder|1ln>|<table|<row|<cell|结束引号>|<cell|结束括号>|<cell|结束书名号>>|<row|<cell|<subtable|<tformat|<cwith|1|1|1|-1|cell-halign|c>|<table|<row|<cell|”>|<cell|’>|<cell|』>|<cell|」>>>>>>|<cell|<subtable|<tformat|<cwith|1|1|1|-1|cell-halign|c>|<table|<row|<cell|)>|<cell|】>>>>>>|<cell|<subtable|<tformat|<cwith|1|1|1|-1|cell-halign|c>|<table|<row|<cell|》>|<cell|〉>>>>>>>>>>
75+
76+
\;
77+
78+
<paragraph|For line end>
79+
80+
<tabular|<tformat|<cwith|2|2|1|1|cell-halign|c>|<cwith|1|1|2|2|cell-halign|r>|<cwith|1|1|3|3|cell-halign|r>|<cwith|1|1|1|-1|cell-tborder|0ln>|<cwith|1|1|1|-1|cell-bborder|1ln>|<cwith|2|2|1|-1|cell-tborder|1ln>|<cwith|1|1|1|1|cell-lborder|0ln>|<cwith|1|1|3|3|cell-rborder|0ln>|<cwith|1|1|2|2|cell-tborder|0ln>|<cwith|1|1|2|2|cell-bborder|1ln>|<cwith|2|2|2|2|cell-tborder|1ln>|<cwith|1|1|2|2|cell-lborder|1ln>|<cwith|1|1|1|1|cell-rborder|1ln>|<cwith|1|1|2|2|cell-rborder|1ln>|<cwith|1|1|3|3|cell-lborder|1ln>|<table|<row|<cell|开始引号>|<cell|开始括号>|<cell|开始书名号>>|<row|<cell|<subtable|<tformat|<cwith|1|1|1|-1|cell-halign|c>|<table|<row|<cell|“>|<cell|‘>|<cell|『>|<cell|「>>>>>>|<cell|<subtable|<tformat|<cwith|1|1|1|-1|cell-halign|c>|<cwith|1|1|1|1|cell-tborder|0ln>|<cwith|1|1|1|1|cell-bborder|0ln>|<cwith|1|1|1|1|cell-lborder|1ln>|<cwith|1|1|2|2|cell-tborder|0ln>|<cwith|1|1|2|2|cell-bborder|0ln>|<cwith|1|1|2|2|cell-lborder|0ln>|<cwith|1|1|1|1|cell-rborder|0ln>|<cwith|1|1|2|2|cell-rborder|1ln>|<table|<row|<cell|(>|<cell|【>>>>>>|<cell|<subtable|<tformat|<cwith|1|1|1|-1|cell-halign|c>|<table|<row|<cell|《>|<cell|〈>>>>>>>>>>
81+
82+
<section|More cases for the bug>
83+
84+
<\note>
85+
The green part is ok.
86+
</note>
87+
88+
<\note>
89+
It is reproducible on GNU Linux with Noto as the default Chinese font using Mogan v1.1.2 beta1.
90+
</note>
91+
92+
<paragraph|For line start>
93+
94+
\| could be at the line start.
95+
96+
<with|language|chinese|<tabular|<tformat|<cwith|1|1|2|2|cell-hyphen|t>|<cwith|1|1|2|2|cell-background|pastel green>|<cwith|1|1|2|2|cell-hyphen|t>|<cwith|1|1|2|2|cell-hyphen|t>|<cwith|1|1|3|3|cell-hyphen|t>|<cwith|1|1|4|4|cell-hyphen|t>|<cwith|1|1|4|4|cell-width|50pt>|<cwith|1|1|4|4|cell-hmode|exact>|<cwith|1|1|3|3|cell-width|50pt>|<cwith|1|1|3|3|cell-hmode|exact>|<cwith|1|1|5|5|cell-hyphen|t>|<cwith|1|1|6|6|cell-hyphen|t>|<cwith|1|1|6|6|cell-width|50pt>|<cwith|1|1|6|6|cell-hmode|exact>|<cwith|1|1|5|5|cell-width|50pt>|<cwith|1|1|5|5|cell-hmode|exact>|<cwith|1|1|7|7|cell-hyphen|t>|<cwith|1|1|7|7|cell-width|50pt>|<cwith|1|1|7|7|cell-hmode|exact>|<cwith|1|1|2|7|cell-background|pastel green>|<cwith|1|1|2|2|cell-width|50pt>|<cwith|1|1|2|2|cell-hmode|exact>|<cwith|1|1|1|1|cell-width|50pt>|<cwith|1|1|1|1|cell-hmode|exact>|<cwith|1|1|1|1|cell-hyphen|t>|<cwith|1|1|1|1|cell-background|pastel green>|<table|<row|<\cell>
97+
我能吞下\|玻璃而不伤身体。
98+
</cell>|<\cell>
99+
我能吞下,玻璃而不伤身体。
100+
</cell>|<\cell>
101+
我能吞下.玻璃而不伤身体。
102+
</cell>|<\cell>
103+
我能吞下:玻璃而不伤身体。
104+
</cell>|<\cell>
105+
我能吞下;玻璃而不伤身体。
106+
</cell>|<\cell>
107+
我能吞下!玻璃而不伤身体。
108+
</cell>|<\cell>
109+
我能吞下?玻璃而不伤身体。
110+
</cell>>>>>>
111+
112+
\;
113+
114+
<with|language|chinese|<tabular|<tformat|<cwith|1|1|1|1|cell-hyphen|t>|<cwith|1|1|1|1|cell-width|50pt>|<cwith|1|1|1|1|cell-hmode|exact>|<cwith|1|1|1|1|cell-background|pastel green>|<cwith|1|1|1|1|cell-width|60pt>|<cwith|1|1|1|1|cell-hmode|exact>|<cwith|1|1|1|1|cell-hyphen|t>|<cwith|1|1|1|1|cell-hyphen|t>|<cwith|1|1|1|1|cell-width|50pt>|<cwith|1|1|1|1|cell-hmode|exact>|<cwith|1|1|2|2|cell-hyphen|t>|<cwith|1|1|3|3|cell-hyphen|t>|<cwith|1|1|3|3|cell-width|50pt>|<cwith|1|1|3|3|cell-hmode|exact>|<cwith|1|1|2|2|cell-width|50pt>|<cwith|1|1|2|2|cell-hmode|exact>|<cwith|1|1|4|4|cell-hyphen|t>|<cwith|1|1|5|5|cell-hyphen|t>|<cwith|1|1|5|5|cell-width|50pt>|<cwith|1|1|5|5|cell-hmode|exact>|<cwith|1|1|4|4|cell-width|50pt>|<cwith|1|1|4|4|cell-hmode|exact>|<cwith|1|1|6|6|cell-hyphen|t>|<cwith|1|1|6|6|cell-width|50pt>|<cwith|1|1|6|6|cell-hmode|exact>|<cwith|1|1|1|6|cell-background|pastel green>|<cwith|1|1|7|7|cell-hyphen|t>|<cwith|1|1|7|7|cell-width|50pt>|<cwith|1|1|7|7|cell-hmode|exact>|<cwith|1|1|7|7|cell-background|pastel green>|<table|<row|<\cell>
115+
我能吞下,玻璃而不伤身体。
116+
</cell>|<\cell>
117+
我能吞下。玻璃而不伤身体。
118+
</cell>|<\cell>
119+
我能吞下:玻璃而不伤身体。
120+
</cell>|<\cell>
121+
我能吞下;玻璃而不伤身体。
122+
</cell>|<\cell>
123+
我能吞下!玻璃而不伤身体。
124+
</cell>|<\cell>
125+
我能吞下?玻璃而不伤身体。
126+
</cell>|<\cell>
127+
我能吞下、玻璃而不伤身体。
128+
</cell>>>>>>
129+
130+
\;
131+
132+
<tabular|<tformat|<cwith|1|1|1|1|cell-hyphen|t>|<cwith|1|1|2|2|cell-hyphen|t>|<cwith|1|1|2|2|cell-width|50pt>|<cwith|1|1|2|2|cell-hmode|exact>|<cwith|1|1|1|1|cell-width|50pt>|<cwith|1|1|1|1|cell-hmode|exact>|<cwith|1|1|3|3|cell-hyphen|t>|<cwith|1|1|3|3|cell-width|50pt>|<cwith|1|1|3|3|cell-hmode|exact>|<cwith|1|1|4|4|cell-hyphen|t>|<cwith|1|1|5|5|cell-hyphen|t>|<cwith|1|1|5|5|cell-width|50pt>|<cwith|1|1|5|5|cell-hmode|exact>|<cwith|1|1|4|4|cell-width|50pt>|<cwith|1|1|4|4|cell-hmode|exact>|<cwith|1|1|3|3|cell-background|pastel green>|<table|<row|<\cell>
133+
我能吞下/玻璃而不伤身体。
134+
</cell>|<\cell>
135+
列奥纳多\<centerdot\>达\<centerdot\>芬奇
136+
</cell>|<\cell>
137+
我能吞下~玻璃而不伤身体。
138+
</cell>|<\cell>
139+
我能吞下-玻璃而不伤身体。
140+
</cell>|<\cell>
141+
我能吞下—玻璃而不伤身体。
142+
</cell>>>>>
143+
144+
\;
145+
146+
<tabular|<tformat|<cwith|1|1|2|2|cell-width|60pt>|<cwith|1|1|2|2|cell-hmode|exact>|<cwith|1|1|2|2|cell-hyphen|t>|<cwith|1|1|1|1|cell-hyphen|t>|<cwith|1|1|2|2|cell-hyphen|t>|<cwith|1|1|2|2|cell-width|50pt>|<cwith|1|1|2|2|cell-hmode|exact>|<cwith|1|1|1|1|cell-width|50pt>|<cwith|1|1|1|1|cell-hmode|exact>|<cwith|1|1|4|4|cell-width|60pt>|<cwith|1|1|4|4|cell-hmode|exact>|<cwith|1|1|4|4|cell-hyphen|t>|<cwith|1|1|3|3|cell-hyphen|t>|<cwith|1|1|4|4|cell-hyphen|t>|<cwith|1|1|4|4|cell-width|50pt>|<cwith|1|1|4|4|cell-hmode|exact>|<cwith|1|1|3|3|cell-width|50pt>|<cwith|1|1|3|3|cell-hmode|exact>|<cwith|1|1|6|6|cell-width|60pt>|<cwith|1|1|6|6|cell-hmode|exact>|<cwith|1|1|6|6|cell-hyphen|t>|<cwith|1|1|5|5|cell-hyphen|t>|<cwith|1|1|6|6|cell-hyphen|t>|<cwith|1|1|6|6|cell-width|50pt>|<cwith|1|1|6|6|cell-hmode|exact>|<cwith|1|1|5|5|cell-width|50pt>|<cwith|1|1|5|5|cell-hmode|exact>|<cwith|1|1|8|8|cell-width|60pt>|<cwith|1|1|8|8|cell-hmode|exact>|<cwith|1|1|8|8|cell-hyphen|t>|<cwith|1|1|7|7|cell-hyphen|t>|<cwith|1|1|8|8|cell-hyphen|t>|<cwith|1|1|8|8|cell-width|50pt>|<cwith|1|1|8|8|cell-hmode|exact>|<cwith|1|1|7|7|cell-width|50pt>|<cwith|1|1|7|7|cell-hmode|exact>|<cwith|1|1|3|8|cell-background|pastel green>|<table|<row|<\cell>
147+
我能吞下玻”璃而不伤身体。
148+
</cell>|<\cell>
149+
我能吞下’玻璃而不伤身体。
150+
</cell>|<\cell>
151+
我能吞下』玻璃而不伤身体。
152+
</cell>|<\cell>
153+
我能吞下」玻璃而不伤身体。
154+
</cell>|<\cell>
155+
我能吞下)玻璃而不伤身体。
156+
</cell>|<\cell>
157+
我能吞下】玻璃而不伤身体。
158+
</cell>|<\cell>
159+
我能吞下》玻璃而不伤身体。
160+
</cell>|<\cell>
161+
我能吞下〉玻璃而不伤身体。
162+
</cell>>>>>
163+
164+
<paragraph|For line end>
165+
166+
<tabular|<tformat|<cwith|1|1|2|2|cell-width|60pt>|<cwith|1|1|2|2|cell-hmode|exact>|<cwith|1|1|2|2|cell-hyphen|t>|<cwith|1|1|1|1|cell-hyphen|t>|<cwith|1|1|2|2|cell-hyphen|t>|<cwith|1|1|2|2|cell-width|50pt>|<cwith|1|1|2|2|cell-hmode|exact>|<cwith|1|1|1|1|cell-width|50pt>|<cwith|1|1|1|1|cell-hmode|exact>|<cwith|1|1|4|4|cell-width|60pt>|<cwith|1|1|4|4|cell-hmode|exact>|<cwith|1|1|4|4|cell-hyphen|t>|<cwith|1|1|3|3|cell-hyphen|t>|<cwith|1|1|4|4|cell-hyphen|t>|<cwith|1|1|4|4|cell-width|50pt>|<cwith|1|1|4|4|cell-hmode|exact>|<cwith|1|1|3|3|cell-width|50pt>|<cwith|1|1|3|3|cell-hmode|exact>|<cwith|1|1|6|6|cell-width|60pt>|<cwith|1|1|6|6|cell-hmode|exact>|<cwith|1|1|6|6|cell-hyphen|t>|<cwith|1|1|5|5|cell-hyphen|t>|<cwith|1|1|6|6|cell-hyphen|t>|<cwith|1|1|6|6|cell-width|50pt>|<cwith|1|1|6|6|cell-hmode|exact>|<cwith|1|1|5|5|cell-width|50pt>|<cwith|1|1|5|5|cell-hmode|exact>|<cwith|1|1|8|8|cell-width|60pt>|<cwith|1|1|8|8|cell-hmode|exact>|<cwith|1|1|8|8|cell-hyphen|t>|<cwith|1|1|7|7|cell-hyphen|t>|<cwith|1|1|8|8|cell-hyphen|t>|<cwith|1|1|8|8|cell-width|50pt>|<cwith|1|1|8|8|cell-hmode|exact>|<cwith|1|1|7|7|cell-width|50pt>|<cwith|1|1|7|7|cell-hmode|exact>|<table|<row|<\cell>
167+
我能吞下“玻璃”而不伤身体。
168+
</cell>|<\cell>
169+
我能吞下‘ ’玻璃而不伤身体。
170+
</cell>|<\cell>
171+
我能吞下『玻璃而不伤身体。
172+
</cell>|<\cell>
173+
我能吞下「玻璃而不伤身体。
174+
</cell>|<\cell>
175+
我能吞下(玻璃而不伤身体。
176+
</cell>|<\cell>
177+
我能吞下【下玻璃而不伤身体。
178+
</cell>|<\cell>
179+
我能吞下《玻璃而不伤身体。
180+
</cell>|<\cell>
181+
我能吞下〈玻璃而不伤身体。
182+
</cell>>>>>
183+
184+
\;
185+
</body>
186+
187+
<\initial>
188+
<\collection>
189+
<associate|page-height|auto>
190+
<associate|page-screen-margin|false>
191+
<associate|page-type|a4>
192+
<associate|page-width|auto>
193+
</collection>
194+
</initial>
195+
196+
<\references>
197+
<\collection>
198+
<associate|auto-1|<tuple|1|?>>
199+
<associate|auto-10|<tuple|5|?>>
200+
<associate|auto-2|<tuple|2|?>>
201+
<associate|auto-3|<tuple|2.1|?>>
202+
<associate|auto-4|<tuple|3|?>>
203+
<associate|auto-5|<tuple|1|?>>
204+
<associate|auto-6|<tuple|2|?>>
205+
<associate|auto-7|<tuple|4|?>>
206+
<associate|auto-8|<tuple|1|?>>
207+
<associate|auto-9|<tuple|2|?>>
208+
<associate|footnote-1|<tuple|1|?>>
209+
<associate|footnote-2|<tuple|2|?>>
210+
<associate|footnr-1|<tuple|1|?>>
211+
<associate|footnr-2|<tuple|2|?>>
212+
</collection>
213+
</references>
214+
215+
<\auxiliary>
216+
<\collection>
217+
<\associate|toc>
218+
<vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|1<space|2spc>Bug Metadata> <datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>> <no-break><pageref|auto-1><vspace|0.5fn>
219+
220+
<vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|2<space|2spc>Description> <datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>> <no-break><pageref|auto-2><vspace|0.5fn>
221+
222+
<with|par-left|<quote|1tab>|2.1<space|2spc>Line break is prohibited between CJK if either is enclosed in an environment <datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>> <no-break><pageref|auto-3>>
223+
224+
<vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|3<space|2spc>Prohibition Rules for Line Start and Line End> <datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>> <no-break><pageref|auto-4><vspace|0.5fn>
225+
226+
<with|par-left|<quote|3tab>|For line start <datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>> <no-break><pageref|auto-5>>
227+
228+
<with|par-left|<quote|3tab>|For line end <datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>> <no-break><pageref|auto-6>>
229+
230+
<vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|4<space|2spc>More cases for the bug> <datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>> <no-break><pageref|auto-7><vspace|0.5fn>
231+
232+
<with|par-left|<quote|3tab>|For line start <datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>> <no-break><pageref|auto-8>>
233+
234+
<with|par-left|<quote|3tab>|For line end <datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>> <no-break><pageref|auto-9>>
235+
236+
<vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|5<space|2spc>行首禁则> <datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>> <no-break><pageref|auto-10><vspace|0.5fn>
237+
</associate>
238+
</collection>
239+
</auxiliary>

src/System/Language/text_language.cpp

+10-12
Original file line numberDiff line numberDiff line change
@@ -479,32 +479,30 @@ chinese_language_rep::chinese_language_rep (string lan_name)
479479
<< string ("") << string ("") << string ("")
480480
<< string ("") << string ("") << string ("")
481481
<< string ("") << string ("") << string ("")
482-
<< string ("") << string ("");
482+
<< string ("") << string ("") << string ("")
483+
<< string ("");
483484
auto full_width_do_not_end= array<string> ();
484485
full_width_do_not_end << string ("") << string ("") << string ("")
485-
<< string ("") << string ("") << string ("");
486+
<< string ("") << string ("") << string ("")
487+
<< string ("") << string ("");
486488

487489
for (int i= 0; i < N (full_width_do_not_start); i++) {
488-
do_not_start << utf8_to_cork (full_width_do_not_start[i]);
490+
do_not_start << utf8_to_herk (full_width_do_not_start[i]);
489491
}
490492
for (int i= 0; i < N (full_width_do_not_end); i++) {
491-
do_not_end << utf8_to_cork (full_width_do_not_end[i]);
493+
do_not_end << utf8_to_herk (full_width_do_not_end[i]);
492494
}
493495

494496
// special full width characters
495-
do_not_start << string ("<#201D>"); //
496497
do_not_start << string ("<#2014>"); //
497-
do_not_start << string ("'"); // ’ <#2019>
498498
do_not_start << string ("<centerdot>");
499-
500-
do_not_end << string ("<#201C>"); //
501-
do_not_end << string ("<#2018>"); //
502499
}
503500

504501
text_property
505502
chinese_language_rep::advance (tree t, int& pos) {
506-
string s= t->label;
507-
if (pos >= N (s)) return &tp_normal_rep;
503+
string s = t->label;
504+
int s_N= N (s);
505+
if (pos >= s_N) return &tp_normal_rep;
508506

509507
if (s[pos] == ' ') {
510508
pos++;
@@ -517,7 +515,7 @@ chinese_language_rep::advance (tree t, int& pos) {
517515
return &tp_cjk_period_rep;
518516
}
519517
else {
520-
while (pos < N (s) && s[pos] != ' ' && s[pos] != '<' &&
518+
while (pos < s_N && s[pos] != ' ' && s[pos] != '<' &&
521519
!do_not_start->contains (s[pos]))
522520
tm_char_forwards (s, pos);
523521
return &tp_cjk_no_break_rep;

0 commit comments

Comments
 (0)