Skip to content

Commit f06fef0

Browse files
committed
fix: keep soft-hyphen breaks at the insertion point
Fixes #162
1 parent 4d68871 commit f06fef0

17 files changed

Lines changed: 251 additions & 356 deletions

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ See `DEVELOPMENT.md` for the current command surface and packaging/release check
9999
- URL-like runs such as `https://...` / `www...` are currently modeled as two breakable preprocessing units when a query exists: the path through the query introducer (`?`), then the query string. This is intentionally narrow and exists to stop obviously bad mid-path URL breaks without forcing the whole query string to fragment character-by-character.
100100
- Mixed app text also pulled in two more keep-worthy preprocessing rules: contextual escaped quote clusters like `\"word\"`, and numeric/time-range runs like `२४×७` / `7:00-9:00`.
101101
- For Southeast Asian scripts or mixed text containing Thai/Lao/Khmer/Myanmar, trust the `Range`-based corpus diagnostics over span-probing; span units can perturb line breaking there.
102-
- The remaining Chrome mixed-app `710px` soft-hyphen miss is extractor-sensitive and not cleanly local. Treat it as paragraph-scale / accumulation-sensitive until a cleaner reproducer appears, and do not patch the engine from only one extractor view.
102+
- The former Chrome mixed-app `710px` soft-hyphen miss is exact again after keeping chosen soft-hyphen breaks at the SHY boundary. Keep mixed app text as a regression canary, and do not reintroduce post-SHY grapheme packing from only one extractor view.
103103
- Safari `Range`-based probe extraction can over-advance across URL query text (`...path?q`) even when the real DOM height and the `span` extractor are exact. Cross-check `--method=span` before changing the engine on Safari URL/query probe misses.
104104
- Keep the current corpus lessons in mind:
105105
- Thai: contextual ASCII quotes were a real keep

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- CJK text followed by opening bracket annotations now wraps like browsers instead of leaving the opening bracket on the previous line (#148).
1212
- `{ wordBreak: 'keep-all' }` now handles no-space mixed Latin, numeric, and CJK text more like browsers.
1313
- Numeric prefix/postfix symbols like `$`, `%`, ``, `+`, ``, and `°` now stay attached to adjacent text the way browser line breaking does (#105).
14+
- Soft-hyphen breaks now stay at the soft-hyphen insertion point instead of pulling post-hyphen graphemes onto the broken line (#162).
1415

1516
## 0.0.5 - 2026-04-09
1617

RESEARCH.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ This log is historical. The current practical steering picture is:
1515
- Myanmar still has two real canaries with residual Chrome/Safari disagreement around quote/follower-style classes, so it remains the main unresolved Southeast Asian frontier.
1616
- Urdu has a real Nastaliq/Naskh canary (`چغد`) with the same narrow-width negative field in Chrome and Safari, so it is clearly a shaping/context class rather than dirty data or a browser-only quirk. It remains parked rather than actively tuned.
1717
- Arabic coarse corpora are clean; the remaining work there is mostly a fine-width edge-fit class, not the old preprocessing/corpus-hygiene problems.
18-
- Mixed app text still matters because it catches product-shaped classes that books miss, especially soft-hyphen and extractor-sensitive cases.
18+
- Mixed app text is exact again in the maintained Chrome/Safari step10 sweeps and still matters as the product-shaped regression canary for URLs, emoji ZWJ runs, hard spaces, and soft hyphens.
1919

2020
## The problem: DOM measurement interleaving
2121

@@ -220,8 +220,8 @@ Important keep:
220220
- model URL/query strings as narrow structured units, not one giant breakable blob
221221

222222
Current status:
223-
- almost entirely clean
224-
- one remaining extractor-sensitive soft-hyphen miss around `710px` still looks paragraph-scale or accumulation-sensitive rather than like a neat local bug
223+
- exact in the maintained Chrome and Safari `step=10` sweeps
224+
- the former Chrome-only `710px` soft-hyphen miss went away after keeping chosen soft-hyphen breaks at the SHY boundary instead of packing post-SHY graphemes
225225

226226
### Thai
227227

TODO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Current priorities:
22

33
1. Keep the canaries honest
44

5-
- Mixed app text still has the extractor-sensitive `710px` soft-hyphen miss.
5+
- Mixed app text is exact again in the maintained Chrome/Safari step10 sweeps; keep it as a product-shaped regression canary rather than an active tuning target.
66
- Chinese is still the clearest active CJK canary: Safari's step10 sweep is clean, while Chrome keeps a broader narrow-width positive field with real font sensitivity.
77
- Myanmar and Urdu remain useful shaping/context canaries, but they are not the active tuning target right now.
88

accuracy/chrome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76825,5 +76825,5 @@
7682576825
"diff": 0
7682676826
}
7682776827
],
76828-
"requestId": "1778228945426-cq4f58"
76828+
"requestId": "1778234152524-g3ze5g"
7682976829
}

accuracy/firefox.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76825,5 +76825,5 @@
7682576825
"diff": 0
7682676826
}
7682776827
],
76828-
"requestId": "1778228951223-53ai40"
76828+
"requestId": "1778234164610-4igphr"
7682976829
}

accuracy/letter-spacing.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"generatedAt": "2026-04-22T05:32:11.275Z",
2+
"generatedAt": "2026-05-08T09:56:13.902Z",
33
"browsers": [
44
"chrome",
55
"safari"
@@ -491,23 +491,23 @@
491491
"line": 1,
492492
"oursStart": 0,
493493
"browserStart": 0,
494-
"oursEnd": 8,
494+
"oursEnd": 6,
495495
"browserEnd": 7,
496-
"oursText": "trans-at",
496+
"oursText": "trans-",
497497
"browserText": "trans­a",
498-
"oursRenderedText": "trans-at",
498+
"oursRenderedText": "trans-",
499499
"browserRenderedText": "trans­a",
500-
"oursContext": "trans­at|lantic transit",
500+
"oursContext": "trans­|atlantic transit",
501501
"browserContext": "trans­a|tlantic transit",
502-
"deltaText": "t",
502+
"deltaText": "a",
503503
"reasonGuess": "our segment sum drifts from full-string width by 0.366px",
504-
"oursSumWidth": 58.41593933105469,
505-
"oursDomWidth": 58.0546875,
506-
"oursFullWidth": 58.0499267578125,
504+
"oursSumWidth": 43.52995300292969,
505+
"oursDomWidth": 43.1640625,
506+
"oursFullWidth": 43.1639404296875,
507507
"browserDomWidth": 46.609375,
508508
"browserFullWidth": 46.60194396972656
509509
},
510-
"extractorSensitivity": null,
510+
"extractorSensitivity": "range mismatch disappears with span",
511511
"message": null
512512
},
513513
{

accuracy/safari.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76825,5 +76825,5 @@
7682576825
"diff": 0
7682676826
}
7682776827
],
76828-
"requestId": "1778228947899-rtghd5"
76828+
"requestId": "1778234157599-qh89bv"
7682976829
}

0 commit comments

Comments
 (0)