Skip to content
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

Deep nested tree #65

Closed
ghost opened this issue Feb 13, 2019 · 5 comments
Closed

Deep nested tree #65

ghost opened this issue Feb 13, 2019 · 5 comments

Comments

@ghost
Copy link

ghost commented Feb 13, 2019

Hi guy, thanks for excellent library, but I have problem with deep nested html tags and often hang the app.

Do we have a way to process this during parsing process.

Currently I do a workaround by flatten the nested wraps
Wrap -> Wrap -> Wrap ......

void _unwrapWidget(Wrap widget, Wrap unwrap)
{
widget.children.forEach((child) {
if (child is Wrap) {
_unwrapWidget(child, unwrap);
}
else {
unwrap.children.add(child);
}
});
}

List _flattenWidgets(List widgetList)
{
List unwrapsWidgetList = List();
widgetList.forEach((widget) {
if (widget is Wrap) {
Wrap unwrap = Wrap();
_unwrapWidget(widget, unwrap);
unwrapsWidgetList.add(unwrap);
}
else {
unwrapsWidgetList.add(widget);
}
});

return unwrapsWidgetList;

}

@The-Redhat
Copy link
Contributor

Do you have set useRichText to true ? If not try that.

@ghost
Copy link
Author

ghost commented Feb 13, 2019

richText to true ignore (or load failed) a lot of tag like span

@Sub6Resources
Copy link
Owner

Yes, I'm working on making progress on #61, which will add support for most of the tags (especially span) that are currently ignored so you can use useRichText

@Sub6Resources
Copy link
Owner

@hoaquo Support for span was just added in version 0.9.5. I plan on eventually deprecating the default parser in favor of the rich text parser (or an improved version of it) once it supports enough tags, so I'm closing this for now.

@ghost
Copy link
Author

ghost commented Mar 12, 2019

Thank you for great work :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants