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

customRender isn't working. #115

Closed
christianwico opened this issue Jun 20, 2019 · 1 comment
Closed

customRender isn't working. #115

christianwico opened this issue Jun 20, 2019 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@christianwico
Copy link

christianwico commented Jun 20, 2019

I tried to use the customRender function to render iframes using this YouTube Player.

Html(
   data: MD.markdownToHtml(post.content), // The breakpoint here triggers.
   customRender: (node, children) {       // The breakpoint here doesn't trigger.
      if (node is dom.Element) {
         if (node.localName == 'iframe') {
            return YoutubePlayer(
               context: context,
               source: node.attributes['src'],
               quality: YoutubeQuality.HD,
            );
         }
      }
   },
   onLinkTap: (String link) => _launchUrl(link),
)

However, it doesn't seem to be working. I tried to use breakpoints to see whether or not they're actually executing, but it seems they aren't.

I tried to breakpoint data and it paused. Of course it worked as the widget rendered my HTML properly. However, the breakpoint in customRender was not triggering and the iframes were not being rendered as I expected.

flutter_html: ^0.10.1

Flutter 1.5.4-hotfix.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 7a4c33425d (7 weeks ago) • 2019-04-29 11:05:24 -0700
Engine • revision 52c7a1e849
Tools • Dart 2.3.0 (build 2.3.0-dev.0.5 a1668566e5)
@Sub6Resources Sub6Resources added the duplicate This issue or pull request already exists label Jun 20, 2019
@Sub6Resources
Copy link
Owner

Yes this is currently an outstanding issue in #64. Support for the customRender property is on the roadmap to return by version 1.0.0 of this plugin. If this is a blocking issue, you can consider setting useRichText to false and the customRender plugin will work as expected (though there are some other rendering issues).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants