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

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

Closed
cacogr opened this issue Nov 21, 2016 · 7 comments
Labels
help wanted P5 The team acknowledges the request but does not plan to address it, it remains open for discussion

Comments

@cacogr
Copy link

cacogr commented Nov 21, 2016

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?

@grizzm0
Copy link
Contributor

grizzm0 commented Nov 21, 2016

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

Configure your parser to use HTML5 instad of XHTML.

@filipesilva
Copy link
Contributor

filipesilva commented Dec 22, 2016

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.

@filipesilva filipesilva added command: build help wanted P5 The team acknowledges the request but does not plan to address it, it remains open for discussion labels Dec 22, 2016
@CarreraPHP
Copy link
Contributor

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

@CarreraPHP
Copy link
Contributor

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

@hansl hansl closed this as completed in aaca100 Dec 28, 2016
MRHarrison pushed a commit to MRHarrison/angular-cli that referenced this issue Feb 9, 2017
@ishitatsuyuki
Copy link
Contributor

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

@TunaYagci
Copy link

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

@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
help wanted P5 The team acknowledges the request but does not plan to address it, it remains open for discussion
Projects
None yet
Development

No branches or pull requests

6 participants