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

Links not working when an other tag is inside the <a> tag and tags not working in general within <a> tags #515

Closed
DFelten opened this issue Jan 26, 2021 · 7 comments · Fixed by #517

Comments

@DFelten
Copy link
Contributor

DFelten commented Jan 26, 2021

I tried the current master and encountered a problem. The links are now wrapping, which looks much nicer. But there is a problem with tags within the links.

As soon as there is another tag within the a tag, the links no longer work.

Reduced example html:

<ul>
<li><a href="https://www.kostenlos.de/dealdoktor-gewinnspiel"><b>200€ MediaMarkt-Gutschein GEWINNEN</b></a> 🍀</li>
<li><a href="https://www.kostenlos.de/dealdoktor-gewinnspiel"><strong>200€ MediaMarkt-Gutschein GEWINNEN</strong></a> 🍀</li>
<li><a href="https://www.kostenlos.de/dealdoktor-gewinnspiel">200€ MediaMarkt-Gutschein GEWINNEN</a> 🍀</li>
</ul>

The first two links don't work, but the third one does. As soon as the <b> or <strong> tag is removed, the link works again. In addition, the links are no longer styled.

Here we used the commit id (b71e9a3):

With the latest master (e5e24d0):

@DFelten DFelten changed the title Links not working when an other tag is inside the <a> tag; Tags not working within <a> tags; Links not working when an other tag is inside the <a> tag; Tags not working within <a> tags Jan 26, 2021
@DFelten DFelten changed the title Links not working when an other tag is inside the <a> tag; Tags not working within <a> tags Links not working when an other tag is inside the <a> tag and tags not working in general within <a> tags Jan 26, 2021
@erickok
Copy link
Collaborator

erickok commented Jan 29, 2021

It's easy to reproduce but I haven't found a solution yet. Basically the inner tags aren't being applied iOS they are just text. Styling as well as linking.

@DFelten
Copy link
Contributor Author

DFelten commented Jan 29, 2021

Then we should definitely wait here with a new version until this bug is fixed or undo the changes until they are resolved. Functioning links are of course quite important.

erickok added a commit to vrtdev/flutter_html that referenced this issue Jan 29, 2021
@erickok
Copy link
Collaborator

erickok commented Jan 29, 2021

I think I solved this issue, both applying the linking to all text spans inside the link as well as application of the styling.

Screenshot 2021-01-29 at 16 07 26

As a side note, I did see flutter/flutter#51936 which is a Flutter framework error, but it only logs the exception, and not crash anything or prevent rendering.

@DFelten
Copy link
Contributor Author

DFelten commented Jan 30, 2021

Thanks, the styling and the links are now working again :) But unfortunately the line break within links is now gone.

My html example wasn't that good. With this example the missing line break is also visible:

<ul>
<li>DealDoktor-Monatsgewinnspiel: <a href="https://www.kostenlos.de/dealdoktor-gewinnspiel"><b>200€ MediaMarkt-Gutschein GEWINNEN</b></a> 🍀</li>
<li>HOHE GEWINNCHANCEN: <a href="https://www.kostenlos.de/dealdoktor-gewinnspiel"><strong>200€ MediaMarkt-Gutschein GEWINNEN</strong></a> 🍀</li>
<li><a href="https://www.kostenlos.de/dealdoktor-gewinnspiel">200€ MediaMarkt-Gutschein GEWINNEN</a> 🍀</li>
</ul>

image

@erickok
Copy link
Collaborator

erickok commented Jan 30, 2021

I'm not sure what you mean. If I use this html:

<ul>
<li>DealDoktor-Monatsgewinnspiel: <a href="https://www.kostenlos.de/dealdoktor-gewinnspiel"><b>200€ MediaMarkt-Gutschein GEWINNEN</b></a> 🍀</li>
<li>HOHE GEWINNCHANCEN: <a href="https://www.kostenlos.de/dealdoktor-gewinnspiel"><strong>200€ MediaMarkt-Gutschein GEWINNEN</strong></a> 🍀</li>
<li><a href="https://www.kostenlos.de/dealdoktor-gewinnspiel">200€ MediaMarkt-Gutschein GEWINNEN</a> 🍀</li>
</ul>
<p>One of the most <span>common</span> <a><b>equations</b> in all of physics is <br /><var>E</var>=<var>m</var><var>c</var><sup>2</sup>.</a></p>

I get this result. That looks right to me?

Screenshot 2021-01-30 at 10 13 15

@DFelten
Copy link
Contributor Author

DFelten commented Jan 30, 2021

I'm confused. This is the result of your example html:

image

Currently I'm using your MR branch:

  flutter_html:
    git:
      url: https://github.com/vrtdev/flutter_html.git
      ref: bugfix/515-link-inner-html-linking-and-styles

@DFelten
Copy link
Contributor Author

DFelten commented Jan 30, 2021

Sorry, after a flutter clean it's now working :) Thanks!

image

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

Successfully merging a pull request may close this issue.

2 participants