First stable release. Adds a fifth first-party port for Dart and Flutter and
closes every cross-port divergence found in a full parity audit of the four
existing ports, so all five now produce byte-identical output on an extended
shared fixture suite.
New port: smooth_reading (Dart, pub.dev)
- Pure Dart, zero dependencies, Dart 3.0+ (Flutter 3.10+); runs in Flutter on
every platform, on the server and on the web. tokenizereturns a sealedToken(WordToken/SeparatorToken) that
maps directly onto FlutterTextSpans;toHtml,toMarkdown,
fixationLength, aconstSmoothOptions, andescapeHtml.- A
Segmenterinterface: the defaultSpecSegmenteris the spec's regex
scanner (identical output to the Python port); apps can plug in a platform
ICU break iterator for dictionary-based Chinese, Japanese and Thai breaks
without touching the algorithm. - A Flutter recipe (
docs/recipes/flutter.md):SmoothTextwidget,
selectable variant, and an ICU segmenter over a platform channel.
Parity fixes (algorithm and markup)
- Kotlin: out-of-range
fixation,saccadeandminWordLengthare clamped
instead of throwing, as the spec and every other port already did. - Kotlin: CDATA sections and unterminated comments pass through exactly as in
the TypeScript core; previously the markup could be corrupted. - Swift: the default (no
locale) path now uses the same dictionary-based
word breaker as the explicit-locale path, so Chinese and Japanese are
broken into words by default as in every other port. - Swift: an empty
classNameemitsclass=""like the other ports. - Tag names follow one grammar in every port (the TypeScript rule: a name
runs to whitespace,/or>;</ code>closes;<code / >self-closes). - Regex-fallback tokenizers (TypeScript without
Intl.Segmenter, Python,
Kotlin'sSpecWordSegmenter, Dart) share one run rule: a continuous run of
Han, Kana, Hangul, Thai, Lao, Khmer or Myanmar characters is one word,
split from adjacent text of other scripts (iPhone手机→iPhone+
手机), with combining marks attached. The table of code-point ranges is
now in the spec. - Python: non-integer numeric options are truncated then clamped instead of
raising, matching the TypeScript core.
Fixtures and spec
- New
fixtures/commoncases for option clamping, CDATA, unterminated
comments, the tag-name grammar and script-boundary splitting; every port
passes them. docs/SPEC.mddocuments the known, accepted differences between ICU word
breaking and the regex fallback (3.14,1,000,snake_case,½, Khmer
coeng clusters) and the optional break-iterator hook.
Release engineering
release.ymlpublishessmooth_readingto pub.dev (automated publishing)
and verifies the Dart version;ci.ymltests Dart 3.0.0 and stable.- npm now publishes under the
latestdist-tag; PyPI as a normal release.