punctilio 3.1.3 → 3.2.0

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 CHANGED
@@ -1,4 +1,4 @@
1
- > *punctilio* (n.): precise observance of formalities.
1
+ > _punctilio_ (n.): precise observance of formalities.
2
2
 
3
3
  [![Test](https://github.com/alexander-turner/punctilio/actions/workflows/test.yml/badge.svg)](https://github.com/alexander-turner/punctilio/actions/workflows/test.yml)
4
4
  [![Lint](https://github.com/alexander-turner/punctilio/actions/workflows/lint.yml/badge.svg)](https://github.com/alexander-turner/punctilio/actions/workflows/lint.yml)
@@ -6,16 +6,16 @@
6
6
 
7
7
  Pretty good at making your text pretty. The most feature-complete and reliable English typography package. `punctilio` transforms plain ASCII into typographically correct Unicode, even across HTML element boundaries.
8
8
 
9
- **Smart quotes** · **Em/en dashes** · **Ellipses** · **Math symbols** · **Legal symbols** · **Arrows** · **Primes** · **Fractions** · **Superscripts** · **Ligatures** · **Non-breaking spaces** · **HTML-aware** · **Bri’ish, German, and French localisation support**
9
+ **Smart quotes** · **Em/en dashes** · **Ellipses** · **Math symbols** · **Legal symbols** · **Arrows** · **Primes** · **Fractions** · **Superscripts** · **Ligatures** · **Non-breaking spaces** · **HTML-aware** · **Markdown support** · **Bri’ish, German, and French localisation support**
10
10
 
11
11
  ```typescript
12
- import { transform } from 'punctilio'
12
+ import { transform } from "punctilio";
13
13
 
14
- transform(`"It's a beautiful thing, the destruction of words..." -- 1984`)
14
+ transform(`"It's a beautiful thing, the destruction of words..." -- 1984`);
15
15
  // → “It’s a beautiful thing, the destruction of words…”—1984
16
16
  ```
17
17
 
18
- **Format-faithful**: Text→text, Markdown→markdown, HTML→html. Transform typography, preserve structure.
18
+ `punctilio` accepts three input formats: text, Markdown, and HTML.
19
19
 
20
20
  ```bash
21
21
  npm install punctilio
@@ -25,52 +25,52 @@ npm install punctilio
25
25
 
26
26
  As far as I can tell, `punctilio` is the most reliable and feature-complete. I built `punctilio` for [my website](https://turntrout.com/design). I wrote[^wrote] and sharpened the core regexes sporadically over several months, exhaustively testing edge cases. Eventually, I decided to spin off the functionality into its own package.
27
27
 
28
- [^wrote]: While Claude is the number one contributor to this repository, that’s because Claude helped me port my existing code and added some features. The core regular expressions (e.g. dashes, quotes, multiplication signs) are human-written and were quite delicate. Those numerous commits don’t show in this repo’s history.
28
+ [^wrote]: While Claude is the number one contributor to this repository, that’s because Claude helped me port my existing code and added some features. The core regular expressions (e.g. dashes, quotes, multiplication signs) are human-written and were quite delicate. Those numerous commits don’t show in this repo’s history.
29
29
 
30
30
  I tested `punctilio` 1.2.9 against [`smartypants`](https://www.npmjs.com/package/smartypants) 0.2.2, [`tipograph`](https://www.npmjs.com/package/tipograph) 0.7.4, [`smartquotes`](https://www.npmjs.com/package/smartquotes) 2.3.2, [`typograf`](https://www.npmjs.com/package/typograf) 7.6.0, and [`retext-smartypants`](https://www.npmjs.com/package/retext-smartypants) 6.2.0.[^python] These other packages have spotty feature coverage and inconsistent impact on text. For example, `smartypants` mishandles quotes after em dashes (though quite hard to see in GitHub’s font) and lacks multiplication sign support.
31
31
 
32
32
  [^python]: The Python libraries I found were closely related to the JavaScript packages. I tested them and found similar scores, so I don’t include separate Python results.
33
33
 
34
- | Input | `smartypants` | `punctilio` |
35
- |:-----:|:-----------------:|:-------:|
36
- | 5x5 | 5x5 (✗) | 5×5 (✓) |
34
+ | Input | `smartypants` | `punctilio` |
35
+ | :------------------------------------: | :----------------------------------------: | :---------: |
36
+ | <span class="no-formatting">5x5</span> | <span class="no-formatting">5x5</span> (✗) | 5×5 (✓) |
37
37
 
38
38
  My [`benchmark.mjs`](https://github.com/alexander-turner/punctilio/blob/main/benchmark.mjs) measures how well libraries handle a [wide range of scenarios](https://github.com/alexander-turner/punctilio/blob/main/benchmark_cases.json). The benchmark normalizes stylistic differences (e.g. non-breaking vs regular space, British vs American dash spacing) for fair comparison.
39
39
 
40
- | Package | Passed (of 157) |
41
- |--------:|:----------------|
42
- | `punctilio` | 155 (99%) |
43
- | `tipograph` | 91 (58%) |
44
- | `typograf` | 74 (47%) |
45
- | `smartquotes` | 72 (46%) |
46
- | `smartypants` | 68 (43%) |
47
- | `retext-smartypants` | 65 (41%) |
48
-
49
- | Feature | Example | `punctilio` | `smartypants` | `tipograph` | `smartquotes` | `typograf` |
50
- |--------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|
51
- | Smart quotes | <span class="no-formatting">"hello" → “hello”</span> | ✓ | ✓ | ✓ | ✓ | ✓ |
52
- | Leading apostrophe | <span class="no-formatting">'Twas → ’Twas</span> | ✓ | ✗ | ✗ | ◐ | ✗ |
53
- | Em dash | <span class="no-formatting">-- → —</span> | ✓ | ✓ | ✗ | ✗ | ✓ |
54
- | En dash (ranges) | <span class="no-formatting">1-5 → 1–5</span> | ✓ | ✗ | ✓ | ✗ | ✗ |
55
- | Minus sign | <span class="no-formatting">-5 → −5</span> | ✓ | ✗ | ✓ | ✗ | ✗ |
56
- | Ellipsis | <span class="no-formatting">... → …</span> | ✓ | ✓ | ✓ | ✗ | ✓ |
57
- | Multiplication | <span class="no-formatting">5x5 → 5×5</span> | ✓ | ✗ | ✗ | ✗ | ◐ |
58
- | Math symbols | <span class="no-formatting">!= → ≠</span> | ✓ | ✗ | ◐ | ✗ | ◐ |
59
- | Legal symbols | <span class="no-formatting">(c) 2004 → © 2004</span> | ✓ | ✗ | ◐ | ✗ | ✓ |
60
- | Arrows | <span class="no-formatting">-> → →</span> | ✓ | ✗ | ◐ | ✗ | ◐ |
61
- | Prime marks | <span class="no-formatting">5'10" → 5′10″</span> | ✓ | ✗ | ✓ | ✓ | ✗ |
62
- | Degrees | <span class="no-formatting">20 C → 20 °C</span> | ✓ | ✗ | ✗ | ✗ | ✓ |
63
- | Fractions | <span class="no-formatting">1/2 → ½</span> | ✓ | ✗ | ✗ | ✗ | ✓ |
64
- | Superscripts | <span class="no-formatting">2nd → 2ⁿᵈ</span> | ✓ | ✗ | ✗ | ✗ | ✗ |
65
- | English localization | <span class="no-formatting">American / British</span> | ✓ | ✗ | ✗ | ✗ | ✗ |
66
- | Ligatures | <span class="no-formatting">?? → ⁇</span> | ✓ | ✗ | ✓ | ✗ | ✗ |
67
- | Non-English quotes | <span class=”no-formatting”>„Hallo”</span> | ✓ | ✗ | ✓ | ✗ | ◐ |
68
- | Non-breaking spaces | <span class="no-formatting">Chapter 1</span> | ✓ | ✗ | ✗ | ✗ | ✓ |
40
+ | Package | Passed (of 157) |
41
+ | -------------------: | :-------------- |
42
+ | `punctilio` | 155 (99%) |
43
+ | `tipograph` | 91 (58%) |
44
+ | `typograf` | 74 (47%) |
45
+ | `smartquotes` | 72 (46%) |
46
+ | `smartypants` | 68 (43%) |
47
+ | `retext-smartypants` | 65 (41%) |
48
+
49
+ | Feature | Example | `punctilio` | `smartypants` | `tipograph` | `smartquotes` | `typograf` |
50
+ | -------------------: | :---------------------------------------------------: | :---------: | :-----------: | :---------: | :-----------: | :--------: |
51
+ | Smart quotes | <span class="no-formatting">"hello" → “hello”</span> | ✓ | ✓ | ✓ | ✓ | ✓ |
52
+ | Leading apostrophe | <span class="no-formatting">'Twas → ’Twas</span> | ✓ | ✗ | ✗ | ◐ | ✗ |
53
+ | Em dash | <span class="no-formatting">-- → —</span> | ✓ | ✓ | ✗ | ✗ | ✓ |
54
+ | En dash (ranges) | <span class="no-formatting">1-5 → 1–5</span> | ✓ | ✗ | ✓ | ✗ | ✗ |
55
+ | Minus sign | <span class="no-formatting">-5 → −5</span> | ✓ | ✗ | ✓ | ✗ | ✗ |
56
+ | Ellipsis | <span class="no-formatting">... → …</span> | ✓ | ✓ | ✓ | ✗ | ✓ |
57
+ | Multiplication | <span class="no-formatting">5x5 → 5×5</span> | ✓ | ✗ | ✗ | ✗ | ◐ |
58
+ | Math symbols | <span class="no-formatting">!= → ≠</span> | ✓ | ✗ | ◐ | ✗ | ◐ |
59
+ | Legal symbols | <span class="no-formatting">(c) 2004 → © 2004</span> | ✓ | ✗ | ◐ | ✗ | ✓ |
60
+ | Arrows | <span class="no-formatting">-> → →</span> | ✓ | ✗ | ◐ | ✗ | ◐ |
61
+ | Prime marks | <span class="no-formatting">5'10" → 5′10″</span> | ✓ | ✗ | ✓ | ✓ | ✗ |
62
+ | Degrees | <span class="no-formatting">20 C → 20 °C</span> | ✓ | ✗ | ✗ | ✗ | ✓ |
63
+ | Fractions | <span class="no-formatting">1/2 → ½</span> | ✓ | ✗ | ✗ | ✗ | ✓ |
64
+ | Superscripts | <span class="no-formatting">2nd → 2ⁿᵈ</span> | ✓ | ✗ | ✗ | ✗ | ✗ |
65
+ | English localization | <span class="no-formatting">American / British</span> | ✓ | ✗ | ✗ | ✗ | ✗ |
66
+ | Ligatures | <span class="no-formatting">?? → ⁇</span> | ✓ | ✗ | ✓ | ✗ | ✗ |
67
+ | Non-English quotes | <span class=”no-formatting”>„Hallo”</span> | ✓ | ✗ | ✓ | ✗ | ◐ |
68
+ | Non-breaking spaces | <span class="no-formatting">Chapter 1</span> | ✓ | ✗ | ✗ | ✗ | ✓ |
69
69
 
70
70
  ### Known limitations of `punctilio`
71
71
 
72
- | Pattern | Behavior | Notes |
73
- |:--------|:---------|:------|
72
+ | Pattern | Behavior | Notes |
73
+ | :--------------------- | :------------------------- | :------------------------------------------------------------------------------------------- |
74
74
  | `'99 but 5' clearance` | `5'` not converted to `5′` | Leading apostrophe is indistinguishable from an opening quote without semantic understanding |
75
75
 
76
76
  ## Test suite
@@ -86,16 +86,16 @@ Other typography libraries take one of two approaches, both with drawbacks. 
86
86
  1. String-based libraries (like [`smartypants`](https://www.npmjs.com/package/smartypants)) transform plain text but are unaware of HTML structure. If you concatenate text from `<em>Wait</em>...`, transform it into `Wait…`, and then try to convert back—you've lost track of where the `</em>` belongs. 
87
87
  2. AST-based libraries (like [`rehype-retext`](https://github.com/rehypejs/rehype-retext)) process each text node individually, preserving structure but losing cross-node information. A quote that opens inside `<em>"Wait</em>` and closes outside it `..."` spans two text node. Processed independently, the library can't tell whether the final `"` is opening or closing, because it never sees both at once. 
88
88
 
89
- `punctilio` introduces *separation boundaries* to get the best of both worlds:
89
+ `punctilio` introduces _separation boundaries_ to get the best of both worlds:
90
90
 
91
91
  1. Flatten the parent container's contents to a string, delimiting element boundaries with a private-use Unicode character (`U+E000`) to avoid unintended matches.
92
92
  2. Every regex allows (and preserves) these characters, treating them as boundaries of a “permeable membrane” through which contextual information flows. For example, `.U+E000..` still becomes `…U+E000`.
93
- 3. Rehydrate the HTML AST. For all *k*, set element *k*’s text content to the segment starting at separator occurrence *k*.
93
+ 3. Rehydrate the HTML AST. For all _k_, set element _k_’s text content to the segment starting at separator occurrence _k_.
94
94
 
95
95
  ```typescript
96
- import { transform, DEFAULT_SEPARATOR } from 'punctilio'
96
+ import { transform, DEFAULT_SEPARATOR } from "punctilio";
97
97
 
98
- transform(`"Wait${DEFAULT_SEPARATOR}"`)
98
+ transform(`"Wait${DEFAULT_SEPARATOR}"`);
99
99
  // → `“Wait”${DEFAULT_SEPARATOR}`
100
100
  // The separator doesn’t block the information that this should be an end-quote!
101
101
  ```
@@ -103,13 +103,13 @@ transform(`"Wait${DEFAULT_SEPARATOR}"`)
103
103
  For `rehype` / `unified` pipelines, use the built-in plugin which handles the separator logic automatically:
104
104
 
105
105
  ```typescript
106
- import rehypePunctilio from 'punctilio/rehype'
106
+ import rehypePunctilio from "punctilio/rehype";
107
107
 
108
108
  unified()
109
109
  .use(rehypeParse)
110
110
  .use(rehypePunctilio)
111
111
  .use(rehypeStringify)
112
- .process('<p><em>"Wait</em>..." -- she said</p>')
112
+ .process('<p><em>"Wait</em>..." -- she said</p>');
113
113
  // → <p><em>“Wait</em>…”—she said</p>
114
114
  // The opening quote inside <em> and the closing quote outside it
115
115
  // are both resolved correctly across the element boundary.
@@ -117,26 +117,26 @@ unified()
117
117
 
118
118
  For Markdown ASTs via `remark`, use `remarkPunctilio` which applies the same separator technique to preserve inline element boundaries, or use `transformMarkdown` for a simpler Markdown-to-Markdown pipeline.
119
119
 
120
- For manual DOM walking or custom transforms, use `transformElement` from `punctilio/rehype`.
120
+ For manual DOM walking or custom transforms, use `transformElement` from `punctilio/rehype`.
121
121
 
122
122
  ## Options
123
123
 
124
- `punctilio` doesn't enable all transformations by default. Fractions and degrees tend to match too aggressively (perfectly applying the degree transformation requires semantic meaning). Superscript letters and punctuation ligatures have spotty font support. Furthermore, `ligatures = true` can change the meaning of text by collapsing question and exclamation marks.
124
+ `punctilio` doesn't enable all transformations by default. Fractions and degrees tend to match too aggressively (perfectly applying the degree transformation requires semantic meaning). Superscript letters and punctuation ligatures have spotty font support. Furthermore, `ligatures = true` can change the meaning of text by collapsing question and exclamation marks.
125
125
 
126
126
  ```typescript
127
127
  transform(text, {
128
- punctuationStyle: 'american' | 'british' | 'german' | 'french' | 'none', // default: 'american'
129
- dashStyle: 'american' | 'british' | 'none', // default: 'american'
130
-
131
- symbols: true, // ellipsis, math, legal, arrows
132
- collapseSpaces: true, // normalize whitespace
133
- fractions: false, // 1/2 → ½
134
- degrees: false, // 20 C → 20 °C
135
- superscript: false, // 1st → 1ˢᵗ
136
- ligatures: false, // ??? → ⁇, ?! → ⁈, !? → ⁉, !!! → !
137
- nbsp: true, // non-breaking spaces (after honorifics, between numbers and units, etc.)
138
- checkIdempotency: true, // verify transform(transform(x)) === transform(x)
139
- })
128
+ punctuationStyle: "american" | "british" | "german" | "french" | "none", // default: 'american'
129
+ dashStyle: "american" | "british" | "none", // default: 'american'
130
+
131
+ symbols: true, // ellipsis, math, legal, arrows
132
+ collapseSpaces: true, // normalize whitespace
133
+ fractions: false, // 1/2 → ½
134
+ degrees: false, // 20 C → 20 °C
135
+ superscript: false, // 1st → 1ˢᵗ
136
+ ligatures: false, // ??? → ⁇, ?! → ⁈, !? → ⁉, !!! → !
137
+ nbsp: true, // non-breaking spaces (after honorifics, between numbers and units, etc.)
138
+ checkIdempotency: true, // verify transform(transform(x)) === transform(x)
139
+ });
140
140
  ```
141
141
 
142
142
  - Fully general prime mark conversion (e.g. `5'10"` → `5′10″`) requires 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.
package/dist/dashes.js CHANGED
@@ -31,9 +31,9 @@ export function enDashNumberRange(text, options = {}) {
31
31
  const rangeEnd = `(?<end>${chr}?[${currencies}]?\\d[\\d.,]*)`; // 20, $200, 2,000
32
32
  const moreSegments = `(?<following>(?:${chr}?[-${MINUS}]${chr}?\\d+)*)`; // -4567 in phone numbers
33
33
  const unitSuffix = `(?<suffix>${chr}?(?:[AaPp][Mm]|[xKBTM]))?`; // am/pm, K/M/B
34
- // Positive ranges: 1-5, $100-$200, €5-€10, p.10-15
34
+ // Positive ranges: 1-5, 5--10, $100-$200, €5-€10, p.10-15
35
35
  const positiveRangePattern = [
36
- phoneAreaCode, wb, notAfterDash, rangeStart, "-", rangeEnd, moreSegments, unitSuffix, wbe
36
+ phoneAreaCode, wb, notAfterDash, rangeStart, "-{1,3}", rangeEnd, moreSegments, unitSuffix, wbe
37
37
  ].join("");
38
38
  text = text.replace(cachedRegExp(positiveRangePattern, "g"), (match, precedingAreaCode, start, end, following, suffix = "") => {
39
39
  if (following)
@@ -54,7 +54,7 @@ export function enDashNumberRange(text, options = {}) {
54
54
  });
55
55
  // Negative ranges: −5-5 → −5–5, −5--2 → −5–−2
56
56
  // Separate regex because MINUS isn't a word char, so \b in ${wb} would match after it
57
- text = text.replace(cachedRegExp(`(?<![${LATIN_LETTERS}])(?<start>${MINUS}\\d[\\d.,]*${chr}?)-(?<neg>-)?(?<end>${chr}?\\d[\\d.,]*)(?<following>(?:${chr}?-${chr}?\\d+)*)(?<suffix>${chr}?[xKBTM])?${wbe}`, "g"), (match, start, neg, end, following, suffix = "") => {
57
+ text = text.replace(cachedRegExp(`(?<![${LATIN_LETTERS}])(?<start>${MINUS}\\d[\\d.,]*${chr}?)-{1,3}?(?<neg>-)?(?<end>${chr}?\\d[\\d.,]*)(?<following>(?:${chr}?-${chr}?\\d+)*)(?<suffix>${chr}?[xKBTM])?${wbe}`, "g"), (match, start, neg, end, following, suffix = "") => {
58
58
  if (following)
59
59
  return match;
60
60
  return `${start}${EN_DASH}${neg ? MINUS : ""}${end}${suffix || ""}`;
@@ -151,10 +151,10 @@ export function hyphenReplace(text, options = {}) {
151
151
  return text;
152
152
  text = minusReplace(text, options);
153
153
  text = enDashDateRange(text, options);
154
+ text = enDashNumberRange(text, options);
154
155
  text = convertParentheticalDashes(text, sep, style);
155
156
  if (style === "american")
156
157
  text = normalizeEmDashSpacing(text, sep);
157
- text = enDashNumberRange(text, options);
158
158
  return text;
159
159
  }
160
160
  //# sourceMappingURL=dashes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dashes.js","sourceRoot":"","sources":["../src/dashes.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,aAAa,EAAE,iBAAiB,EAAE,eAAe,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAWzJ,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,GAAG,eAAe,CAAA;AAEjI;;;;GAIG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,CAAU,CAAA;AAEpF,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM;IACtD,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU;IAChE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;IACjC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,E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A;IAED,OAAO,IAAI,CAAA;AACb,CAAC;AAED,gCAAgC;AAChC,MAAM,UAAU,aAAa,CAAC,IAAY,EAAE,UAAuB,EAAE;IACnE,MAAM,GAAG,GAAG,OAAO,CAAC,SAAS,IAAI,iBAAiB,CAAA;IAClD,MAAM,KAAK,GAAG,OAAO,CAAC,SAAS,IAAI,UAAU,CAAA;IAC7C,IAAI,KAAK,KAAK,MAAM;QAAE,OAAO,IAAI,CAAA;IACjC,IAAI,GAAG,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IAClC,IAAI,GAAG,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IACrC,IAAI,GAAG,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IACvC,IAAI,GAAG,0BAA0B,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAA;IACnD,IAAI,KAAK,KAAK,UAAU;QAAE,IAAI,GAAG,sBAAsB,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;IAClE,OAAO,IAAI,CAAA;AACb,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "punctilio",
3
- "version": "3.1.3",
3
+ "version": "3.2.0",
4
4
  "description": "Smart typography transformations: curly quotes, em-dashes, en-dashes, and more",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/dashes.ts CHANGED
@@ -49,9 +49,9 @@ export function enDashNumberRange(text: string, options: DashOptions = {}): stri
49
49
  const moreSegments = `(?<following>(?:${chr}?[-${MINUS}]${chr}?\\d+)*)` // -4567 in phone numbers
50
50
  const unitSuffix = `(?<suffix>${chr}?(?:[AaPp][Mm]|[xKBTM]))?` // am/pm, K/M/B
51
51
 
52
- // Positive ranges: 1-5, $100-$200, €5-€10, p.10-15
52
+ // Positive ranges: 1-5, 5--10, $100-$200, €5-€10, p.10-15
53
53
  const positiveRangePattern = [
54
- phoneAreaCode, wb, notAfterDash, rangeStart, "-", rangeEnd, moreSegments, unitSuffix, wbe
54
+ phoneAreaCode, wb, notAfterDash, rangeStart, "-{1,3}", rangeEnd, moreSegments, unitSuffix, wbe
55
55
  ].join("")
56
56
 
57
57
  text = text.replace(
@@ -75,7 +75,7 @@ export function enDashNumberRange(text: string, options: DashOptions = {}): stri
75
75
  // Separate regex because MINUS isn't a word char, so \b in ${wb} would match after it
76
76
  text = text.replace(
77
77
  cachedRegExp(
78
- `(?<![${LATIN_LETTERS}])(?<start>${MINUS}\\d[\\d.,]*${chr}?)-(?<neg>-)?(?<end>${chr}?\\d[\\d.,]*)(?<following>(?:${chr}?-${chr}?\\d+)*)(?<suffix>${chr}?[xKBTM])?${wbe}`,
78
+ `(?<![${LATIN_LETTERS}])(?<start>${MINUS}\\d[\\d.,]*${chr}?)-{1,3}?(?<neg>-)?(?<end>${chr}?\\d[\\d.,]*)(?<following>(?:${chr}?-${chr}?\\d+)*)(?<suffix>${chr}?[xKBTM])?${wbe}`,
79
79
  "g"
80
80
  ),
81
81
  (match, start, neg, end, following, suffix = "") => {
@@ -221,8 +221,8 @@ export function hyphenReplace(text: string, options: DashOptions = {}): string {
221
221
  if (style === "none") return text
222
222
  text = minusReplace(text, options)
223
223
  text = enDashDateRange(text, options)
224
+ text = enDashNumberRange(text, options)
224
225
  text = convertParentheticalDashes(text, sep, style)
225
226
  if (style === "american") text = normalizeEmDashSpacing(text, sep)
226
- text = enDashNumberRange(text, options)
227
227
  return text
228
228
  }
@@ -106,6 +106,7 @@ describe("hyphenReplace", () => {
106
106
  describe("number ranges to en dashes", () => {
107
107
  it.each([
108
108
  ["Pages 1-5", `Pages 1${EN_DASH}5`],
109
+ ["5--10", `5${EN_DASH}10`],
109
110
  ["2000-2020", `2000${EN_DASH}2020`],
110
111
  ["2018-2021. Then 1-3", `2018${EN_DASH}2021. Then 1${EN_DASH}3`],
111
112
  ["p.10-15", `p.10${EN_DASH}15`],
@@ -186,6 +187,9 @@ describe("enDashNumberRange", () => {
186
187
  ["$100-$200", `$100${EN_DASH}$200`],
187
188
  ["$1.50-$3.50", `$1.50${EN_DASH}$3.50`],
188
189
  ["$1-3", `$1${EN_DASH}3`],
190
+ ["5--10", `5${EN_DASH}10`], // Double dash as range separator
191
+ ["5---10", `5${EN_DASH}10`], // Triple dash as range separator
192
+ ["$100--$200", `$100${EN_DASH}$200`], // Double dash with currency
189
193
  ["1 - 2", "1 - 2"], // Spaced ranges should not change
190
194
  // Multiplier suffixes
191
195
  ["1-10x", `1${EN_DASH}10x`], // lowercase x for multiplier