typeset 3.0.0-beta.4
typeset: ^3.0.0-beta.4 copied to clipboard
Flutter inline text formatter for chat-style markup with plug-and-play usage and granular configuration for rendering, links, and editing.
Changelog #
All notable changes to this project are documented in this file.
3.0.0-beta.4 #
Changed #
- The parser reads formatting and AutoLink URLs in a single left-to-right pass (previously a second pass over the parsed text). A URL containing
*,_,~,`or\is now kept whole:https://x.com/a_b_candhttps://en.wikipedia.org/wiki/Foo_(bar)are one link instead of a link plus formatting. A style marker right after a URL still closes an open style (*see www.flutter.dev*). - AutoLink matches schemes case-insensitively (
Https://,HTTP://,WWW.), as phone keyboards capitalise the first word. - AutoLink trims a trailing
'and…, and ends a URL at full-width/CJK punctuation (https://x.dev,然后).
Fixed #
- The text field (
TypeSetEditingController) no longer stores every keystroke's text in the shared document cache, which filled it with half-typed messages and pushed out the ones that are shown again. It keeps only its own last result. - Tapping an autolink now fires its recognizer, and links are exposed to screen readers (the recognizer is set on each text leaf).
- The editing controller paints exactly
controller.textwhen it contains escapes (\*), so the caret no longer drifts. - A rejected AutoLink URL no longer repeats its trailing punctuation (
www.flutter.dev.→..). - Linear time on adversarial input: runs of literal markers or escapes, runs of
**/__, a URL followed by many), and editor rendering of many escapes were quadratic.
Notes #
- Nested underline, strikethrough and links share one decoration thickness, colour and style (a Flutter
TextStylelimit): adecorationThicknessinunderlineStylealso thickens a nested strikethrough. Documented onTypeSetStyle.underlineStyle; the example app no longer sets one. - An inline
customValidatorclosure (or aTypeSetAutoLinkConfigbuilt insidebuild()with one) is a new object on every build, so the document cache can't reuse the parse. Create the config once, outsidebuild().
3.0.0-beta.3 #
Complete architecture rewrite with AST-based parser, config cascade, AutoLink, and LRU caching.
Upgrading from v2.x? Follow the Migration Guide.
