Skip to content

index.html styles bundle link tag not closed causes problem with strict HTML validation #3217

Closed

Description

@cacogr

OS?

Windows 10

Versions.

angular-cli: 1.0.0-beta.20-4
node: 6.9.1
npm: 3.10.8

I believe #2646 introduced a change in which styles are bundled in their own css file in a link tag in index.html. The problem is this link tag is missing the closing / thus not passing strict validation.

Line 13, Column 88: end tag for "link" omitted, but OMITTAG NO was specified
…f="styles.6aa49abe71cac0b676ea04c83b8009cd.bundle.css" rel="stylesheet"></head>
You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".

The template engine we have in the server, used to inject environment variables, etc. in the index.html before serving it, requires it to be a well-formed XHTML so every element must be closed.

Can you do anything about it?

Activity

  1. grizzm0 commented on Nov 21, 2016

    @grizzm0
    Contributor

    Angular-cli uses HTML5 and not XHTML. Elements without closing / is perfectly valid in HTML5.

    Configure your parser to use HTML5 instad of XHTML.

  2. filipesilva commented on Dec 22, 2016

    @filipesilva
    Contributor

    As @grizzm0 said HTML5 is perfectly fine with unclosed tags. I'm happy to review a PR that adds self closing tags if it helps people though.

    Probably somewhere in the HtmlWebpackPlugin config I'd say.

  3. added
    help wantedLabel noting an issue which the team is looking for contribution from the community to fix
    P5The team acknowledges the request but does not plan to address it, it remains open for discussion
    on Dec 22, 2016
  4. CarreraPHP commented on Dec 26, 2016

    @CarreraPHP
    Contributor

    Adding xhtml:true option to htmlwebpackplugin should enable closing tag. It should be added in webpack-build-common.ts file

  5. CarreraPHP commented on Dec 26, 2016

    @CarreraPHP
    Contributor

    @filipesilva @cacogr, PR #3743 created to add this feature.

  6. added a commit that references this issue on Feb 9, 2017
    46340fd
  7. ishitatsuyuki commented on Mar 30, 2017

    @ishitatsuyuki
    Contributor

    Just to note you, this will be disabled again if my PR #5753 is merged. XHTML means one redundant character in minifying.

  8. TunaYagci commented on Oct 11, 2017

    @TunaYagci

    Hey @CarreraPHP @filipesilva how do we enable this option? I couldn't compile CLI's index.html from Spring (thymeleaf) without doing this.

  9. 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.

  10. locked and limited conversation to collaborators on Sep 7, 2019
  11. added a commit that references this issue on May 29, 2026
    3e7e3b0
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

    P5The team acknowledges the request but does not plan to address it, it remains open for discussionhelp wantedLabel noting an issue which the team is looking for contribution from the community to fix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions