Skip to content

Commit 4a512dc

Browse files
committed
Update goldens and fix 'q' tag
1 parent 4ddeb1e commit 4a512dc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+7
-3
lines changed

example/lib/main.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ const htmlData = """
4747
Solve for <var>x<sub>n</sub></var>: log<sub>2</sub>(<var>x</var><sup>2</sup>+<var>n</var>) = 9<sup>3</sup>
4848
<p>One of the most <span>common</span> equations in all of physics is <br /><var>E</var>=<var>m</var><var>c</var><sup>2</sup>.</p>
4949
<h3>Table support (with custom styling!):</h3>
50+
<p>
51+
<q>Famous quote...</q>
52+
</p>
5053
<table>
5154
<colgroup>
5255
<col width="50%" />

lib/html_parser.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -476,12 +476,13 @@ class HtmlParser extends StatelessWidget {
476476
/// properties.
477477
static StyledElement _processBeforesAndAfters(StyledElement tree) {
478478
if (tree.style?.before != null) {
479-
tree.children.insert(0, TextContentElement(text: tree.style.before));
479+
tree.children?.insert(0, TextContentElement(text: tree.style.before, style: tree.style));
480480
}
481481
if (tree.style?.after != null) {
482-
tree.children.add(TextContentElement(text: tree.style.after));
482+
tree.children?.add(TextContentElement(text: tree.style.after, style: tree.style));
483+
} else {
484+
tree.children?.forEach(_processBeforesAndAfters);
483485
}
484-
tree.children?.forEach(_processBeforesAndAfters);
485486
return tree;
486487
}
487488

test/goldens/a.png

161 Bytes

test/goldens/abbr.png

237 Bytes

test/goldens/acronym.png

173 Bytes

test/goldens/address.png

216 Bytes

test/goldens/article.png

212 Bytes

test/goldens/aside.png

198 Bytes

test/goldens/b.png

70 Bytes

test/goldens/bdi.png

187 Bytes

0 commit comments

Comments
 (0)