-
-
Notifications
You must be signed in to change notification settings - Fork 889
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<li> issues with block children #123
Comments
cpboyd
changed the title
<li> (and likely other blocks) with <p> children
<li> issues with block children
Jul 12, 2019
One workaround that I used for my specific issue with BlockText withLeadingChar(String newLeadingChar) {
return BlockText(
child: child,
padding: padding,
margin: margin,
leadingChar: newLeadingChar,
decoration: decoration,
);
}
...
// filter out empty widgets
List<Widget> children = [];
String skippedLeadingChar = '';
widgetList.forEach((dynamic w) {
if (w is BlockText) {
if (!isEmpty(skippedLeadingChar) && isEmpty(w.leadingChar)) {
w = w.withLeadingChar(skippedLeadingChar);
}
if (w.child.text == null) return;
TextSpan childTextSpan = w.child.text;
if (isEmpty(childTextSpan.text) &&
(childTextSpan.children == null ||
childTextSpan.children.isEmpty)) {
if (!isEmpty(w.leadingChar)) {
skippedLeadingChar = w.leadingChar;
}
return;
}
} else if (w is LinkBlock) {
if (w.children.isEmpty) return;
} else if (w is LinkTextSpan) {
if (w.text.isEmpty && w.children.isEmpty) return;
}
children.add(w);
skippedLeadingChar = '';
}); |
Ah, thanks for the bug report. I'll work on getting this issue fixed. |
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So, I've got content that is of the form:
The
leadingChar
never gets rendered because there's no direct TextSpan child.This appears to be because of the root node reset: https://github.com/Sub6Resources/flutter_html/blob/master/lib/rich_text_parser.dart#L716
The text was updated successfully, but these errors were encountered: