Skip to content

customRender isn't working. #115

@christianwico

Description

@christianwico

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions