Skip to content

Commit a6a7dd1

Browse files
committed
Fix some text rendering issues related to relationship of newlines and br elements
1 parent 7e08742 commit a6a7dd1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/custom_render.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,7 @@ CustomRender blockElementRender({Style? style, List<InlineSpan>? children}) =>
145145
context.tree.children[i - 1] is ReplacedElement)
146146
TextSpan(text: "\n"),
147147
context.parser.parseTree(context, childTree),
148-
if (context.parser.shrinkWrap &&
149-
i != context.tree.children.length - 1 &&
148+
if (i != context.tree.children.length - 1 &&
150149
childTree.style.display == Display.BLOCK &&
151150
childTree.element?.localName != "html" &&
152151
childTree.element?.localName != "body")
@@ -260,8 +259,10 @@ CustomRender replacedElementRender(
260259
CustomRender textContentElementRender({String? text}) =>
261260
CustomRender.inlineSpan(
262261
inlineSpan: (context, buildChildren) => TextSpan(
263-
text: (text ?? (context.tree as TextContentElement).text)
264-
.transformed(context.tree.style.textTransform)));
262+
style: context.style.generateTextStyle(),
263+
text: (text ?? (context.tree as TextContentElement).text)
264+
.transformed(context.tree.style.textTransform),
265+
));
265266

266267
CustomRender base64ImageRender() =>
267268
CustomRender.widget(widget: (context, buildChildren) {

0 commit comments

Comments
 (0)