Skip to content

Commit 7a96575

Browse files
authored
add negative sign processing to CJK custom algorithms (w3c#12717)
Signed-off-by: saku <saku@email.sakupi01.com>
1 parent ce92296 commit 7a96575

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

css-counter-styles-3/Overview.bs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2200,6 +2200,9 @@ Chinese: ''simp-chinese-informal'', ''simp-chinese-formal'', ''trad-chinese-info
22002200
the representation is the character for 0 specified for the given counter style.
22012201
Skip the rest of this algorithm.
22022202

2203+
<li>If the counter value is negative,
2204+
instead use the absolute value of the counter value for the remaining steps of this algorithm.
2205+
22032206
<li>Initially represent the counter value as a decimal number.
22042207
For each digit that is not 0,
22052208
append the appropriate digit marker to the digit.
@@ -2214,7 +2217,12 @@ Chinese: ''simp-chinese-informal'', ''simp-chinese-formal'', ''trad-chinese-info
22142217

22152218
<li>Replace the digits 0-9 with the appropriate character
22162219
for the given counter style.
2217-
Return the resultant string as the representation of the counter value.
2220+
2221+
<li>If the counter value was negative,
2222+
prepend the appropriate negative sign character for the given counter style
2223+
as specified in the table of characters for each style.
2224+
2225+
<li>Return the resultant string as the representation of the counter value.
22182226
</ol>
22192227

22202228
For all of these counter styles,
@@ -2401,6 +2409,9 @@ Chinese: ''simp-chinese-informal'', ''simp-chinese-formal'', ''trad-chinese-info
24012409
the representation is the character for 0 specified for the given counter style.
24022410
Skip the rest of this algorithm.
24032411

2412+
<li>If the counter value is negative,
2413+
instead use the absolute value of the counter value for the remaining steps of this algorithm.
2414+
24042415
<li>Initially represent the counter value as a decimal number.
24052416
Starting from the right (ones place),
24062417
split the decimal number into groups of four digits.
@@ -2447,7 +2458,12 @@ Chinese: ''simp-chinese-informal'', ''simp-chinese-formal'', ''trad-chinese-info
24472458

24482459
<li>Replace the digits 0-9 with the appropriate character
24492460
for the given counter style.
2450-
Return the resultant string as the representation of the counter value.
2461+
2462+
<li>If the counter value was negative,
2463+
prepend the appropriate negative sign character for the given counter style
2464+
as specified in the table of characters for each style.
2465+
2466+
<li>Return the resultant string as the representation of the counter value.
24512467
</ol>
24522468

24532469
For all of these counter styles, the descriptors are the same as for the [[#limited-range-required|limited range variants]],

0 commit comments

Comments
 (0)