chore: Follow up html rendering
This commit is contained in:
parent
a9a23c6309
commit
979b30e0aa
1 changed files with 16 additions and 13 deletions
|
|
@ -130,9 +130,10 @@ class HtmlMessage extends StatelessWidget {
|
||||||
if (node is! dom.Element) {
|
if (node is! dom.Element) {
|
||||||
// Inside of a list so we add some prefix text:
|
// Inside of a list so we add some prefix text:
|
||||||
var text = node.text ?? '';
|
var text = node.text ?? '';
|
||||||
|
if (text == '\n') text = '';
|
||||||
if (node.parent?.localName == 'li') {
|
if (node.parent?.localName == 'li') {
|
||||||
if (node.parent?.parent?.localName == 'ul') {
|
if (node.parent?.parent?.localName == 'ul') {
|
||||||
text = '◦ $text';
|
text = '• $text';
|
||||||
}
|
}
|
||||||
if (node.parent?.parent?.localName == 'ol') {
|
if (node.parent?.parent?.localName == 'ol') {
|
||||||
text =
|
text =
|
||||||
|
|
@ -172,7 +173,7 @@ class HtmlMessage extends StatelessWidget {
|
||||||
uri: href,
|
uri: href,
|
||||||
outerContext: context,
|
outerContext: context,
|
||||||
fontSize: fontSize,
|
fontSize: fontSize,
|
||||||
color: textColor,
|
color: linkStyle.color,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -187,7 +188,7 @@ class HtmlMessage extends StatelessWidget {
|
||||||
uri: href,
|
uri: href,
|
||||||
outerContext: context,
|
outerContext: context,
|
||||||
fontSize: fontSize,
|
fontSize: fontSize,
|
||||||
color: textColor,
|
color: linkStyle.color,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -410,16 +411,18 @@ class HtmlMessage extends StatelessWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) => Text.rich(
|
Widget build(BuildContext context) {
|
||||||
_renderHtml(
|
return Text.rich(
|
||||||
parser.parse(html).body ?? dom.Element.html(''),
|
_renderHtml(
|
||||||
context,
|
parser.parse(html).body ?? dom.Element.html(''),
|
||||||
),
|
context,
|
||||||
style: TextStyle(
|
),
|
||||||
fontSize: fontSize,
|
style: TextStyle(
|
||||||
color: textColor,
|
fontSize: fontSize,
|
||||||
),
|
color: textColor,
|
||||||
);
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class MatrixPill extends StatelessWidget {
|
class MatrixPill extends StatelessWidget {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue