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

html parser: text nodes do not close void tags #5528

Closed
vicb opened this issue Dec 1, 2015 · 6 comments
Closed

html parser: text nodes do not close void tags #5528

vicb opened this issue Dec 1, 2015 · 6 comments

Comments

@vicb
Copy link
Contributor

vicb commented Dec 1, 2015

<h1> start <br> end </h1>

br is not closed

@yfain
Copy link

yfain commented Dec 2, 2015

I was getting errors when closing tags as in <textarea ... /> . After changing to <textarea></textarea> the errors were gone.

@genereux
Copy link

genereux commented Dec 2, 2015

I got errors using <img/>, or <img></img>.

vicb added a commit to vicb/angular that referenced this issue Dec 2, 2015
@pkozlowski-opensource
Copy link
Member

@genereux <img> is a void element and according to the spec:

Void elements only have a start tag; end tags must not be specified for void elements.

@genereux
Copy link

genereux commented Dec 3, 2015

I tried also <img> but it is still not working.
<a class="navbar-brand" href="#"> <img alt="Brand" src=""> </a>
What could be the reason?

@vicb
Copy link
Contributor Author

vicb commented Dec 3, 2015

The reason is that you have a text node " " (white space) after your img tag.

Note that your html is valid but because of a bug in our parser things went wrong.

Before the next release, you should remove the space.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants