flutter_html_css_text_transform 0.2.0
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_extensionon 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_html3.0.0 parsestext-transformintoStyle.textTransformand its text builtin applies that field, but the value never gets from the element to its text.Style()defaults the field tononerather than null, and the cascade doeschild.textTransform ?? textTransform, so the child'snonewins every time, and every text node is such a child.<p style="text-transform: uppercase">hello</p>rendershello. Silent.doc/text_transform.mdhas the table, and every row is pinned by a test. - The fix is a subtree walk at the
preProcessingstep, the same shape asflutter_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 explicitnoneincluded, becauseflutter_htmlvisits 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-nonefield still counts, which is howHtml(style:)and a<style>rule get through. - The keyword is read in any letter case.
flutter_html's own parser is case-sensitive and readsUPPERCASEasnone. - The transform itself is still
flutter_html's, and I measured rather than fixed it:capitalizelowercases everything first and only uppercases an ASCII letter after a space or a period, soiPhoneisIphone,3rd placeis3Rd Place,über allesisüBer Allesand a word split across<b>gets a second capital.uppercasekeepsß. 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-uppercaseand Vuetify 0.1.1text-uppercase,text-capitalizeandtext-noneall render through this extension.