flutter_html_css_text_transform 0.2.0 copy "flutter_html_css_text_transform: ^0.2.0" to clipboard
flutter_html_css_text_transform: ^0.2.0 copied to clipboard

A flutter_html extension that renders text-transform, which flutter_html 3.0.0 parses and then never applies: uppercase, lowercase and capitalize reach the text.

0.2.0 #

  • Renamed from flutter_html_css_text_transform_extension on pub.flutter-io.cn. The old package stays published and is marked discontinued with this one as its replacement. Class names are unchanged.

0.1.0 #

  • Initial release. flutter_html 3.0.0 parses text-transform into Style.textTransform and its text builtin applies that field, but the value never gets from the element to its text. Style() defaults the field to none rather than null, and the cascade does child.textTransform ?? textTransform, so the child's none wins every time, and every text node is such a child. <p style="text-transform: uppercase">hello</p> renders hello. Silent. doc/text_transform.md has the table, and every row is pinned by a test.
  • The fix is a subtree walk at the preProcessing step, the same shape as flutter_html_css_text_metrics's cascade: an element whose inline style states a transform writes it into every descendant that states none of its own, text nodes included. A nearer statement wins, an explicit none included, because flutter_html visits parents first and the descendant then writes its own subtree. The statement is read from the raw attribute, not from the field, since the field cannot tell "none by default" from "none stated"; a non-none field still counts, which is how Html(style:) and a <style> rule get through.
  • The keyword is read in any letter case. flutter_html's own parser is case-sensitive and reads UPPERCASE as none.
  • The transform itself is still flutter_html's, and I measured rather than fixed it: capitalize lowercases everything first and only uppercases an ASCII letter after a space or a period, so iPhone is Iphone, 3rd place is 3Rd Place, über alles is üBer Alles and a word split across <b> gets a second capital. uppercase keeps ß. All in the doc table.
  • Order rules, all measured against the released siblings in both orders: none. Text metrics, font size and line height write other fields at the same step; the stylesheet, Bootstrap and Vuetify packages write the attribute one step earlier. Bootstrap 0.1.2 text-uppercase and Vuetify 0.1.1 text-uppercase, text-capitalize and text-none all render through this extension.
0
likes
160
points
38
downloads

Documentation

API reference

Publisher

verified publisherchaosworld.cc

Weekly Downloads

A flutter_html extension that renders text-transform, which flutter_html 3.0.0 parses and then never applies: uppercase, lowercase and capitalize reach the text.

Repository (GitLab)
View/report issues
Contributing

Topics

#flutter-html #css #html #extension #text-transform

License

MPL-2.0 (license)

Dependencies

flutter, flutter_html, html

More

Packages that depend on flutter_html_css_text_transform