Skip to content

Commit 99d79c4

Browse files
committed
docs: advanced usage of punctuation unification
1 parent fc5119e commit 99d79c4

File tree

2 files changed

+35
-3
lines changed

2 files changed

+35
-3
lines changed

docs/design.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,7 @@ We are figuring out all the requirements by several options below:
176176

177177
These options can format and determine punctuations to be used.
178178

179-
The option `adjustedFullWidthPunctuation` defines which fullwidth punctuations zhlint will treat them as halfwidth punctuations when processing the further spaces issues around them. Usually it's just about quotations since the fullwidth quotations in morder Chinese fonts actually are only rendered in halfwidth.
180-
181-
<!-- TODO: more details about `adjustedFullWidthPunctuation` -->
179+
The option `adjustedFullWidthPunctuation` defines which fullwidth punctuations zhlint will treat them as halfwidth punctuations when processing the further spaces issues around them. Usually it's just about quotations since the fullwidth quotations in morder Chinese fonts actually are only rendered in halfwidth. For more details, including advanced usage, see README.
182180

183181
**For spaces**
184182

docs/index.md

+34
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,40 @@ type RuleOptions = {
319319
// Convert traditional Chinese punctuations into simplified ones or vice versa.
320320
// default preset: `simplified`
321321
// e.g. `「文字」` -> `“文字”`
322+
//
323+
// besides the above, we also unify some common punctuations below:
324+
//
325+
// // U+2047 DOUBLE QUESTION MARK, U+203C DOUBLE EXCLAMATION MARK
326+
// // U+2048 QUESTION EXCLAMATION MARK, U+2049 EXCLAMATION QUESTION MARK
327+
// '??': ['⁇'],
328+
// '!!': ['‼'],
329+
// '?!': ['⁈'],
330+
// '!?': ['⁉'],
331+
//
332+
// // U+002F SOLIDUS, U+FF0F FULLWIDTH SOLIDUS
333+
// '/': ['/', '/'],
334+
//
335+
// // U+FF5E FULLWIDTH TILDE
336+
// '~': ['~', '~'],
337+
//
338+
// // U+2026 HORIZONTAL ELLIPSIS, U+22EF MIDLINE HORIZONTAL ELLIPSIS
339+
// '…': ['…', '⋯'],
340+
//
341+
// // U+25CF BLACK CIRCLE, U+2022 BULLET, U+00B7 MIDDLE DOT,
342+
// // U+2027 HYPHENATION POINT, U+30FB KATAKANA MIDDLE DOT
343+
// '·': ['●', '•', '·', '‧', '・'],
344+
//
345+
// advanced usage: you can also specify a more detailed map like:
346+
//
347+
// ```
348+
// {
349+
// default: true, // follow all the default preset
350+
// '「': ['“', '【'], // convert `“` or `【` into `「`
351+
// '」': ['”', '】'], // convert `”` or `】` into `」`
352+
// '…': true, // follow the default preset for this character
353+
// '·': false, // not unify any of these characters
354+
// }
355+
// ```
322356
unifiedPunctuation?: 'traditional' | 'simplified' | Record<string, boolean | string[]> & { default: boolean }
323357

324358
// Special case: skip `fullWidthPunctuation` for abbreviations.

0 commit comments

Comments
 (0)