andyduke / styled_text_package

Text widget with formatted text using tags. Makes it easier to use formatted text in multilingual applications.
https://pub.dev/packages/styled_text
BSD 3-Clause "New" or "Revised" License
75 stars 48 forks source link

Removes single and double quotations from the String being displayed. #13

Closed TheObviousChico closed 3 years ago

TheObviousChico commented 3 years ago

Say, I want to display. i.e: Lisa asked Shane "How was the weather?" asked Lisa. I want to display the quotations marks but it's being trim out and doesn't even leaves the spacing between the words. Like I'''''''''m -> I m but does Im instead. Also using a raw string does not seem to help. Ran through the code and saw that I could use [& a p o s ;] in my String to get the ' character but it would be nice to use ' " in the String itself.

Thanks in advance.

andyduke commented 3 years ago

Replace the quotation mark " with "

Example:

StyledText(
  text: 'Quoted Test: <b>&quot;bold&quot;</b> text.',
  styles: {
    'b': TextStyle(fontWeight: FontWeight.bold),
  },
),

Will be drawn as: Quoted Test: "bold" text.

TheObviousChico commented 3 years ago

Yes, in which I found out by going through the source code but most people wouldn't know that so it at least needs to be documented. 🙂

andyduke commented 3 years ago

Yes, in which I found out by going through the source code but most people wouldn't know that so it at least needs to be documented. 🙂

I've added an escaping instruction to the documentation.