punctilio 1.1.2 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -15
- package/dist/constants.d.ts +21 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +25 -0
- package/dist/constants.js.map +1 -1
- package/dist/symbols.d.ts.map +1 -1
- package/dist/symbols.js +73 -45
- package/dist/symbols.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -45,8 +45,8 @@ My [`benchmark.mjs`](./benchmark.mjs) measures how well libraries handle a [wide
|
|
|
45
45
|
|
|
46
46
|
| Feature | Example | `smartypants` | `tipograph` | `smartquotes` | `typograf` | `punctilio` |
|
|
47
47
|
|--------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|
|
|
48
|
-
| Smart quotes | "hello" →
|
|
49
|
-
| Leading apostrophe | 'Twas →
|
|
48
|
+
| Smart quotes | "hello" → “hello” | ✓ | ✓ | ✓ | ✓ | ✓ |
|
|
49
|
+
| Leading apostrophe | 'Twas → ’Twas | ✗ | ✗ | ✓ | ✗ | ✓ |
|
|
50
50
|
| Em dash | -- → — | ✓ | ✗ | ✗ | ✓ | ✓ |
|
|
51
51
|
| En dash (ranges) | 1-5 → 1–5 | ✗ | ✓ | ✗ | ✗ | ✓ |
|
|
52
52
|
| Minus sign | -5 → −5 | ✗ | ✓ | ✗ | ✗ | ✓ |
|
|
@@ -61,14 +61,14 @@ My [`benchmark.mjs`](./benchmark.mjs) measures how well libraries handle a [wide
|
|
|
61
61
|
| Superscripts | 1st → 1ˢᵗ | ✗ | ✗ | ✗ | ✗ | ✓ |
|
|
62
62
|
| Localization | American/British | ✗ | ✗ | ✗ | ✗ | ✓ |
|
|
63
63
|
| Ligatures | ?? → ⁇ | ✗ | ✓ | ✗ | ✗ | ✓ |
|
|
64
|
-
| Non-English quotes | „Hallo
|
|
64
|
+
| Non-English quotes | „Hallo” (German) | ✗ | ✓ | ✗ | ✓ | ✗ |
|
|
65
65
|
| Non-breaking spaces | Chapter 1 | ✗ | ✗ | ✗ | ✓ | ✗ |
|
|
66
66
|
|
|
67
|
-
`typograf` uniquely inserts non-breaking spaces to prevent bad line breaks (e.g. before numbers, after colons). I might add this to `punctilio` in the future. `punctilio
|
|
67
|
+
`typograf` uniquely inserts non-breaking spaces to prevent bad line breaks (e.g. before numbers, after colons). I might add this to `punctilio` in the future. `punctilio`’s other missing feature is non-English quote support—feel free to make a pull request!
|
|
68
68
|
|
|
69
69
|
## Works with HTML DOMs via separation boundaries
|
|
70
70
|
|
|
71
|
-
Other typography libraries either transform plain strings or operate on AST nodes individually (`retext-smartypants` [can’t map changes back to HTML](https://github.com/rehypejs/rehype-retext)). But real HTML has text spanning multiple elements—if you concatenate text from `<em>Wait</em>...`, transform it, then try to split it back,
|
|
71
|
+
Other typography libraries either transform plain strings or operate on AST nodes individually (`retext-smartypants` [can’t map changes back to HTML](https://github.com/rehypejs/rehype-retext)). But real HTML has text spanning multiple elements—if you concatenate text from `<em>Wait</em>...`, transform it, then try to split it back, youve lost track of where `</em>` belonged.
|
|
72
72
|
|
|
73
73
|
`punctilio` introduces _separation boundaries_. First, insert a “separator” character (default: `U+E000`) at each element boundary before transforming (like at the start and end of an `<em>`). Every regex allows this character mid-pattern without breaking matches. For example, `.[SEP]..` still becomes `…[SEP]`. `punctilio` validates the output by ensuring the separator count remains the same.
|
|
74
74
|
|
|
@@ -95,7 +95,7 @@ transform(text, {
|
|
|
95
95
|
punctuationStyle: 'american' | 'british' | 'none', // default: 'american'
|
|
96
96
|
dashStyle: 'american' | 'british' | 'none', // default: 'american'
|
|
97
97
|
|
|
98
|
-
symbols: true, // math, legal, arrows
|
|
98
|
+
symbols: true, // math, legal, arrows, primes
|
|
99
99
|
collapseSpaces: true, // normalize whitespace
|
|
100
100
|
fractions: false, // 1/2 → ½
|
|
101
101
|
degrees: false, // 20 C → 20 °C
|
|
@@ -105,12 +105,11 @@ transform(text, {
|
|
|
105
105
|
})
|
|
106
106
|
```
|
|
107
107
|
|
|
108
|
-
|
|
109
|
-
-
|
|
110
|
-
-
|
|
111
|
-
|
|
112
|
-
The `
|
|
113
|
-
-
|
|
114
|
-
-
|
|
115
|
-
|
|
116
|
-
`punctilio` is idempotent by design: `transform(transform(text))` always equals `transform(text)`. If performance is critical, set `checkIdempotency: false` to skip the verification pass.
|
|
108
|
+
- Prime marks (`5'10"` → `5′10″`) require semantic understanding to distinguish from closing quotes (e.g. `"Term 1"` should produce closing quotes). `punctilio` counts quotes to heuristically guess whether the matched number at the end of a quote (if not, it requires a prime mark). Other libraries like `tipograph` 0.7.4 use simpler patterns that make more mistakes. That said, `punctilio` is still not perfect and will sometimes wrongly convert to ending quotation marks: `transform('I said "5" sounds right"')` will wrongly produce a closed double quote after the 5” instead of a double prime (correct).
|
|
109
|
+
- The `american` style follows the [Chicago Manual of Style](https://www.chicagomanualofstyle.org/):
|
|
110
|
+
- Periods and commas go inside quotation marks (“Hello,” she said.)
|
|
111
|
+
- Unspaced em-dashes between words (word—word)
|
|
112
|
+
- The `british` style follows [Oxford style](https://www.ox.ac.uk/sites/files/oxford/Style%20Guide%20quick%20reference%20A-Z.pdf):
|
|
113
|
+
- Periods and commas go outside quotation marks (“Hello”, she said.)
|
|
114
|
+
- Spaced en-dashes between words (word – word)
|
|
115
|
+
- `punctilio` is idempotent by design: `transform(transform(text))` always equals `transform(text)`. If performance is critical, set `checkIdempotency: false` to skip the verification pass.
|
package/dist/constants.d.ts
CHANGED
|
@@ -112,4 +112,25 @@ export declare function wordBoundaryStart(escapedSeparator: string): string;
|
|
|
112
112
|
* // With text "1st\uE000ly": \b would match after t, but wbe won't
|
|
113
113
|
*/
|
|
114
114
|
export declare function wordBoundaryEnd(escapedSeparator: string): string;
|
|
115
|
+
/**
|
|
116
|
+
* Pattern string for space characters (regular space and non-breaking space).
|
|
117
|
+
* Use inside regex character classes: `[${SPACE_CHARS}]`
|
|
118
|
+
*/
|
|
119
|
+
export declare const SPACE_CHARS: string;
|
|
120
|
+
/**
|
|
121
|
+
* Creates a lookbehind pattern that matches after whitespace, separator, or start of string.
|
|
122
|
+
* Used for arrow patterns and other constructs that should appear at word boundaries.
|
|
123
|
+
*
|
|
124
|
+
* @param escapedSeparator - Regex-escaped separator string
|
|
125
|
+
* @returns Pattern string: `(?<=[\\s${sep}]|^)`
|
|
126
|
+
*/
|
|
127
|
+
export declare function spaceBoundaryStart(escapedSeparator: string): string;
|
|
128
|
+
/**
|
|
129
|
+
* Creates a lookahead pattern that matches before whitespace, separator, or end of string.
|
|
130
|
+
* Used for arrow patterns and other constructs that should appear at word boundaries.
|
|
131
|
+
*
|
|
132
|
+
* @param escapedSeparator - Regex-escaped separator string
|
|
133
|
+
* @returns Pattern string: `(?=[\\s${sep}]|$)`
|
|
134
|
+
*/
|
|
135
|
+
export declare function spaceBoundaryEnd(escapedSeparator: string): string;
|
|
115
136
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkDlB,CAAA;AAEV;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa,sFAAsF,CAAA;AAEhH;;;GAGG;AACH,eAAO,MAAM,iBAAiB,WAAW,CAAA;AACzC,eAAO,MAAM,yBAAyB,QAAwC,CAAA;AAE9E;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAAC,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAElE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAAC,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAEhE"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkDlB,CAAA;AAEV;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa,sFAAsF,CAAA;AAEhH;;;GAGG;AACH,eAAO,MAAM,iBAAiB,WAAW,CAAA;AACzC,eAAO,MAAM,yBAAyB,QAAwC,CAAA;AAE9E;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAAC,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAElE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAAC,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,QAA6B,CAAA;AAErD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAEnE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAEjE"}
|
package/dist/constants.js
CHANGED
|
@@ -119,4 +119,29 @@ export function wordBoundaryStart(escapedSeparator) {
|
|
|
119
119
|
export function wordBoundaryEnd(escapedSeparator) {
|
|
120
120
|
return `\\b(?!${escapedSeparator}*\\w)`;
|
|
121
121
|
}
|
|
122
|
+
/**
|
|
123
|
+
* Pattern string for space characters (regular space and non-breaking space).
|
|
124
|
+
* Use inside regex character classes: `[${SPACE_CHARS}]`
|
|
125
|
+
*/
|
|
126
|
+
export const SPACE_CHARS = ` ${UNICODE_SYMBOLS.NBSP}`;
|
|
127
|
+
/**
|
|
128
|
+
* Creates a lookbehind pattern that matches after whitespace, separator, or start of string.
|
|
129
|
+
* Used for arrow patterns and other constructs that should appear at word boundaries.
|
|
130
|
+
*
|
|
131
|
+
* @param escapedSeparator - Regex-escaped separator string
|
|
132
|
+
* @returns Pattern string: `(?<=[\\s${sep}]|^)`
|
|
133
|
+
*/
|
|
134
|
+
export function spaceBoundaryStart(escapedSeparator) {
|
|
135
|
+
return `(?<=[\\s${escapedSeparator}]|^)`;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Creates a lookahead pattern that matches before whitespace, separator, or end of string.
|
|
139
|
+
* Used for arrow patterns and other constructs that should appear at word boundaries.
|
|
140
|
+
*
|
|
141
|
+
* @param escapedSeparator - Regex-escaped separator string
|
|
142
|
+
* @returns Pattern string: `(?=[\\s${sep}]|$)`
|
|
143
|
+
*/
|
|
144
|
+
export function spaceBoundaryEnd(escapedSeparator) {
|
|
145
|
+
return `(?=[\\s${escapedSeparator}]|$)`;
|
|
146
|
+
}
|
|
122
147
|
//# sourceMappingURL=constants.js.map
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,kBAAkB,MAAM,sBAAsB,CAAA;AAErD;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,QAAQ,EAAE,QAAQ;IAClB,cAAc,EAAE,QAAQ;IACxB,SAAS,EAAE,QAAQ;IACnB,UAAU,EAAE,QAAQ;IACpB,SAAS,EAAE,QAAQ;IACnB,UAAU,EAAE,QAAQ;IACpB,SAAS,EAAE,QAAQ;IACnB,MAAM,EAAE,QAAQ;IAChB,WAAW,EAAE,QAAQ;IACrB,UAAU,EAAE,QAAQ;IACpB,gBAAgB,EAAE,QAAQ;IAC1B,WAAW,EAAE,QAAQ;IACrB,UAAU,EAAE,QAAQ;IACpB,aAAa,EAAE,QAAQ;IACvB,KAAK,EAAE,QAAQ;IACf,YAAY,EAAE,QAAQ;IACtB,YAAY,EAAE,QAAQ;IACtB,YAAY,EAAE,QAAQ;IACtB,YAAY,EAAE,QAAQ;IACtB,YAAY,EAAE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AAE,aAAkB,GAAG,MAAM,CAkBpF;AAED,gDAAgD;AAChD,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEnD;AAcD,iFAAiF;AACjF,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,aAAkB,GAAG,MAAM,CAWtF;AAED,gFAAgF;AAChF,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,aAAkB,GAAG,MAAM,CASjF"}
|
package/dist/symbols.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Symbol transformations: ellipses, multiplication, math symbols, arrows.
|
|
3
3
|
*/
|
|
4
4
|
import escapeStringRegexp from "escape-string-regexp";
|
|
5
|
-
import { UNICODE_SYMBOLS, ESCAPED_DEFAULT_SEPARATOR, LATIN_LETTERS, wordBoundaryEnd } from "./constants.js";
|
|
6
|
-
const { ELLIPSIS, MULTIPLICATION, NOT_EQUAL, PLUS_MINUS, COPYRIGHT, REGISTERED, TRADEMARK, DEGREE, ARROW_RIGHT, ARROW_LEFT, ARROW_LEFT_RIGHT, APPROXIMATE, LESS_EQUAL, GREATER_EQUAL, PRIME, DOUBLE_PRIME,
|
|
5
|
+
import { UNICODE_SYMBOLS, ESCAPED_DEFAULT_SEPARATOR, LATIN_LETTERS, wordBoundaryEnd, SPACE_CHARS, spaceBoundaryStart, spaceBoundaryEnd } from "./constants.js";
|
|
6
|
+
const { ELLIPSIS, MULTIPLICATION, NOT_EQUAL, PLUS_MINUS, COPYRIGHT, REGISTERED, TRADEMARK, DEGREE, ARROW_RIGHT, ARROW_LEFT, ARROW_LEFT_RIGHT, APPROXIMATE, LESS_EQUAL, GREATER_EQUAL, PRIME, DOUBLE_PRIME, SUPERSCRIPT_ST, SUPERSCRIPT_ND, SUPERSCRIPT_RD, SUPERSCRIPT_TH, DOUBLE_QUESTION, QUESTION_EXCLAMATION, EXCLAMATION_QUESTION, } = UNICODE_SYMBOLS;
|
|
7
7
|
/** Convert "..." to "…". */
|
|
8
8
|
export function ellipsis(text, options = {}) {
|
|
9
9
|
const chr = options.separator
|
|
@@ -51,35 +51,53 @@ export function multiplication(text, options = {}) {
|
|
|
51
51
|
});
|
|
52
52
|
return text;
|
|
53
53
|
}
|
|
54
|
+
/** Math symbol replacement map: ASCII → Unicode */
|
|
55
|
+
const MATH_SYMBOL_MAP = [
|
|
56
|
+
[/!=/g, NOT_EQUAL],
|
|
57
|
+
[/\+\/-/g, PLUS_MINUS],
|
|
58
|
+
[/\+-/g, PLUS_MINUS],
|
|
59
|
+
[/<=/g, LESS_EQUAL],
|
|
60
|
+
[/>=/g, GREATER_EQUAL],
|
|
61
|
+
[/~=/g, APPROXIMATE],
|
|
62
|
+
[/=~/g, APPROXIMATE],
|
|
63
|
+
];
|
|
54
64
|
/** Convert !=, <=, >=, +/-, ~= to Unicode equivalents. */
|
|
55
65
|
export function mathSymbols(text) {
|
|
56
|
-
|
|
57
|
-
.replace(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
.replace(/<=/g, LESS_EQUAL)
|
|
61
|
-
.replace(/>=/g, GREATER_EQUAL)
|
|
62
|
-
.replace(/~=/g, APPROXIMATE)
|
|
63
|
-
.replace(/=~/g, APPROXIMATE);
|
|
66
|
+
for (const [pattern, replacement] of MATH_SYMBOL_MAP) {
|
|
67
|
+
text = text.replace(pattern, replacement);
|
|
68
|
+
}
|
|
69
|
+
return text;
|
|
64
70
|
}
|
|
71
|
+
/** Legal symbol replacement map: ASCII → Unicode */
|
|
72
|
+
const LEGAL_SYMBOL_MAP = [
|
|
73
|
+
[/\(c\)/gi, COPYRIGHT],
|
|
74
|
+
[/\(r\)/gi, REGISTERED],
|
|
75
|
+
[/\(tm\)/gi, TRADEMARK],
|
|
76
|
+
];
|
|
65
77
|
/** Convert (c), (r), (tm) to ©, ®, ™. */
|
|
66
78
|
export function legalSymbols(text) {
|
|
67
|
-
|
|
68
|
-
.replace(
|
|
69
|
-
|
|
70
|
-
|
|
79
|
+
for (const [pattern, replacement] of LEGAL_SYMBOL_MAP) {
|
|
80
|
+
text = text.replace(pattern, replacement);
|
|
81
|
+
}
|
|
82
|
+
return text;
|
|
71
83
|
}
|
|
84
|
+
/** Arrow pattern map: arrow shape → Unicode symbol */
|
|
85
|
+
const ARROW_MAP = [
|
|
86
|
+
[`<-+${"%CHR%"}?>`, ARROW_LEFT_RIGHT], // Bidirectional: <-> or <-->
|
|
87
|
+
["-+>", ARROW_RIGHT], // Right: -> or -->
|
|
88
|
+
["<-+", ARROW_LEFT], // Left: <- or <--
|
|
89
|
+
];
|
|
72
90
|
/** Convert -> and <-> to arrows. */
|
|
73
91
|
export function arrows(text, options = {}) {
|
|
74
92
|
const chr = options.separator
|
|
75
93
|
? escapeStringRegexp(options.separator)
|
|
76
94
|
: ESCAPED_DEFAULT_SEPARATOR;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
95
|
+
const start = spaceBoundaryStart(chr);
|
|
96
|
+
const end = spaceBoundaryEnd(chr);
|
|
97
|
+
for (const [arrowPattern, replacement] of ARROW_MAP) {
|
|
98
|
+
const pattern = new RegExp(`${start}${arrowPattern.replace("%CHR%", chr)}${end}`, "g");
|
|
99
|
+
text = text.replace(pattern, replacement);
|
|
100
|
+
}
|
|
83
101
|
return text;
|
|
84
102
|
}
|
|
85
103
|
/** Convert "20 C" or "20 F" to "20 °C" or "20 °F". Only matches uppercase C/F. */
|
|
@@ -98,22 +116,27 @@ export function primeMarks(text, options = {}) {
|
|
|
98
116
|
const chr = options.separator
|
|
99
117
|
? escapeStringRegexp(options.separator)
|
|
100
118
|
: ESCAPED_DEFAULT_SEPARATOR;
|
|
101
|
-
//
|
|
102
|
-
//
|
|
103
|
-
// Examples: 5'
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
119
|
+
// Convert quotes to primes using quote balancing
|
|
120
|
+
// Only convert if quotes are balanced (even count before) to avoid converting closing quotes
|
|
121
|
+
// Examples: 5' → 5′ ✓, 12" → 12″ ✓, 'Term 1' → 'Term 1' ✓, "Term 1" → "Term 1" ✓
|
|
122
|
+
const quotePrimePairs = [
|
|
123
|
+
["'", PRIME],
|
|
124
|
+
['"', DOUBLE_PRIME],
|
|
125
|
+
];
|
|
126
|
+
for (const [quote, prime] of quotePrimePairs) {
|
|
127
|
+
const pattern = new RegExp(`(?<digit>\\d)(?<sep>${chr}?)${quote}(?<afterSep>${chr}?)(?![${LATIN_LETTERS}])`, "g");
|
|
128
|
+
text = text.replace(pattern, (match, digit, sep, afterSep, offset) => {
|
|
129
|
+
const textBefore = text.slice(0, offset);
|
|
130
|
+
const quoteCount = (textBefore.match(new RegExp(quote, "g")) || []).length;
|
|
131
|
+
if (quoteCount % 2 === 0) {
|
|
132
|
+
return `${digit}${sep}${prime}${afterSep}`;
|
|
133
|
+
}
|
|
134
|
+
return match;
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
// Feet-inches pattern: convert " after ′ + digit (e.g., 5′10" → 5′10″)
|
|
109
138
|
const feetInchesPattern = new RegExp(`(?<primeAndNum>${PRIME}${chr}?\\d${chr}?)"`, "g");
|
|
110
139
|
text = text.replace(feetInchesPattern, `$<primeAndNum>${DOUBLE_PRIME}`);
|
|
111
|
-
// Double prime Pattern 2: Standalone inches
|
|
112
|
-
// Negative lookbehind: ensures no opening quote within 20 chars before the digit
|
|
113
|
-
// Negative lookahead: ensures not followed by word characters
|
|
114
|
-
// Matches: 12" wide ✓, but not: "Term 1" ✗
|
|
115
|
-
const standaloneInchesPattern = new RegExp(`(?<!["${LEFT_DOUBLE_QUOTE}]${chr}?[^"${chr}]{0,20})(?<numWithSep>\\d${chr}?)"(?!${chr}?[${LATIN_LETTERS}\\d_])`, "g");
|
|
116
|
-
text = text.replace(standaloneInchesPattern, `$<numWithSep>${DOUBLE_PRIME}`);
|
|
117
140
|
return text;
|
|
118
141
|
}
|
|
119
142
|
const FRACTION_MAP = {
|
|
@@ -173,23 +196,28 @@ export function superscriptOrdinal(text, options = {}) {
|
|
|
173
196
|
}
|
|
174
197
|
/** Collapse multiple spaces to single space. */
|
|
175
198
|
export function collapseSpaces(text) {
|
|
176
|
-
return text.replace(new RegExp(`(?<first>[
|
|
199
|
+
return text.replace(new RegExp(`(?<first>[${SPACE_CHARS}])[${SPACE_CHARS}]+`, "g"), "$<first>");
|
|
177
200
|
}
|
|
201
|
+
/**
|
|
202
|
+
* Punctuation ligature map: [first char, repeated char, replacement]
|
|
203
|
+
* Pattern: first(sep)?repeated(?:sep?repeated)* → replacement
|
|
204
|
+
* Order matters: handle mixed punctuation first, then repeated
|
|
205
|
+
*/
|
|
206
|
+
const PUNCTUATION_LIGATURE_MAP = [
|
|
207
|
+
["\\?", "!", QUESTION_EXCLAMATION], // ?!+ → ⁈
|
|
208
|
+
["!", "\\?", EXCLAMATION_QUESTION], // !?+ → ⁉
|
|
209
|
+
["\\?", "\\?", DOUBLE_QUESTION], // ??+ → ⁇
|
|
210
|
+
["!", "!", "!"], // !!+ → ! (normalize)
|
|
211
|
+
];
|
|
178
212
|
/** Convert ?? to ⁇, ?! to ⁈, !? to ⁉. Poor font support, disabled by default. */
|
|
179
213
|
export function punctuationLigatures(text, options = {}) {
|
|
180
214
|
const chr = options.separator
|
|
181
215
|
? escapeStringRegexp(options.separator)
|
|
182
216
|
: ESCAPED_DEFAULT_SEPARATOR;
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
// !?+ → ⁉ (exclamation followed by one or more question marks)
|
|
188
|
-
text = text.replace(new RegExp(`!(${chr})?\\?(?:${chr}?\\?)*`, "g"), (_match, sep) => EXCLAMATION_QUESTION + (sep || ""));
|
|
189
|
-
// ??+ → ⁇ (two or more question marks squashed to ligature)
|
|
190
|
-
text = text.replace(new RegExp(`\\?(${chr})?\\?(?:${chr}?\\?)*`, "g"), (_match, sep) => DOUBLE_QUESTION + (sep || ""));
|
|
191
|
-
// !!+ → ! (two or more exclamation marks squashed to single)
|
|
192
|
-
text = text.replace(new RegExp(`!(${chr})?!(?:${chr}?!)*`, "g"), (_match, sep) => "!" + (sep || ""));
|
|
217
|
+
for (const [first, repeated, replacement] of PUNCTUATION_LIGATURE_MAP) {
|
|
218
|
+
const pattern = new RegExp(`${first}(${chr})?${repeated}(?:${chr}?${repeated})*`, "g");
|
|
219
|
+
text = text.replace(pattern, (_match, sep) => replacement + (sep || ""));
|
|
220
|
+
}
|
|
193
221
|
return text;
|
|
194
222
|
}
|
|
195
223
|
/** Apply all symbol transforms. degrees/fractions excluded (too aggressive). */
|
package/dist/symbols.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"symbols.js","sourceRoot":"","sources":["../src/symbols.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,kBAAkB,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,yBAAyB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"symbols.js","sourceRoot":"","sources":["../src/symbols.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,kBAAkB,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,yBAAyB,EAAE,aAAa,EAAE,eAAe,EAAE,WAAW,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAS9J,MAAM,EACJ,QAAQ,EACR,cAAc,EACd,SAAS,EACT,UAAU,EACV,SAAS,EACT,UAAU,EACV,SAAS,EACT,MAAM,EACN,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,aAAa,EACb,KAAK,EACL,YAAY,EACZ,cAAc,EACd,cAAc,EACd,cAAc,EACd,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,oBAAoB,GACrB,GAAG,eAAe,CAAA;AAEnB,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