2000calories / flutter_easy_rich_text

The EasyRichText widget provides an easy way to use RichText.
https://pub.dev/packages/easy_rich_text
MIT License
80 stars 33 forks source link

Handle html as starting text #33

Closed giorgio79 closed 1 year ago

giorgio79 commented 2 years ago

Any plans for having HTML as base text and adding tags on top of that? This would introduce another can of worms, eg matching across tags etc., but there are some nice solutions like https://github.com/padolsey/findAndReplaceDOMText

EasyRichText(
  "I want <span class="whatever">blue font. I want</span> bold font. I want italic font.",
  patternList: [
    EasyRichTextPattern(
      targetString: 'want blue',
      style: TextStyle(color: Colors.blue),
    ),
    EasyRichTextPattern(
      targetString: 'bold',
      style: TextStyle(fontWeight: FontWeight.bold),
    ),
    EasyRichTextPattern(
      targetString: 'italic',
      style: TextStyle(fontStyle: FontStyle.italic),
    ),
  ],
),