Skip to content

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

Closed

Description

@vicb

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

br is not closed

Activity

  1. yfain commented on Dec 2, 2015

    @yfain

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

  2. genereux commented on Dec 2, 2015

    @genereux

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

  3. pkozlowski-opensource commented on Dec 2, 2015

    @pkozlowski-opensource
    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.

  4. added a commit that references this issue on Dec 2, 2015
    e4d206c
  5. genereux commented on Dec 3, 2015

    @genereux

    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?

  6. vicb commented on Dec 3, 2015

    @vicb
    ContributorAuthor

    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.

  7. angular-automatic-lock-bot commented on Sep 7, 2019

    @angular-automatic-lock-bot

    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.

  8. locked and limited conversation to collaborators on Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions