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

[QUESTION] Recursive TagExtension #1410

Open
romainpurchla opened this issue Jan 26, 2024 · 1 comment
Open

[QUESTION] Recursive TagExtension #1410

romainpurchla opened this issue Jan 26, 2024 · 1 comment
Labels
documentation Issues in our documentation, or suggestions on how the documentation should be improved extensions question

Comments

@romainpurchla
Copy link

Hello,

If I use <a> inside <p> with TagExtension for both, the first TagExtension works but the second does not.

How I can make TagExtension recursive ?

Example :

String html = "<p>This is my html <a href="https://myurl.com">My link</a></p>

[...]

extensions: [
   TagExtension(
          tagsToExtend: {"a"},
          builder: (extensionContext) {
            return Semantics(
                button: true,
                child: GestureDetector(
                    onTap: () {
                      HcLaunchURL(extensionContext.element!.attributes["href"]);
                    },
                    child: Text(extensionContext.element!.text,
                        style: TextStyle(
                          color: Colors.red,
                        ),
                        textAlign: TextAlign.start)));
          },
   ),
   TagExtension(
          tagsToExtend: {"p"},
          builder: (extensionContext) {
            return Padding(
                padding: EdgeInsets.fromLTRB(0, 10, 0, 10),
                child: Text(
                      extensionContext.element!.text));
          },
   ),
]
@thinkingalaud
Copy link

I have a similar issue. @romainpurchla did you find a workaround to this?

@Sub6Resources Sub6Resources added extensions documentation Issues in our documentation, or suggestions on how the documentation should be improved labels Mar 12, 2025
@Sub6Resources Sub6Resources moved this to Todo in flutter_html Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Issues in our documentation, or suggestions on how the documentation should be improved extensions question
Projects
Status: Todo
Development

No branches or pull requests

3 participants