You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Rich Text parser is missing support for the <font /> tag and thus renders no content. The HTML parser has this support.
I've modified the parser to accept font and to also render the color if it's a HEX string. I'll see if I can arrange for a pull request, e.g.
case "strong":
childStyle = childStyle.merge(TextStyle(fontWeight: FontWeight.bold));
break;
case "font":
Color c;
String color = node.attributes['color'] ?? '';
if (color.startsWith('#')) {
// A hex color
c = HexToColor(color);
}
childStyle = childStyle.merge(TextStyle(
color: c,
));
break;
case "i":
HexToColor is a simple class to render the hex string, e.g.
In theory, font takes an 'rgb(a,b,c)' string too so that should be easy to implement. It also handles color names such as 'red' but I can't see an easy way of converting these to a Color object
It's possible that we could do something with the size argument of font too but I currently don't need that option.
The text was updated successfully, but these errors were encountered:
The Rich Text parser is missing support for the
<font />
tag and thus renders no content. The HTML parser has this support.I've modified the parser to accept font and to also render the color if it's a HEX string. I'll see if I can arrange for a pull request, e.g.
HexToColor
is a simple class to render the hex string, e.g.In theory, font takes an
'rgb(a,b,c)'
string too so that should be easy to implement. It also handles color names such as 'red' but I can't see an easy way of converting these to aColor
objectIt's possible that we could do something with the
size
argument of font too but I currently don't need that option.The text was updated successfully, but these errors were encountered: