question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

End Tag (/) removed from <link>

See original GitHub issue

Resubmitting as per Gulp User Suggestion.(https://github.com/gulpjs/gulp/issues/639)

We use HTML 5 based template engine (Thymeleaf), which will use strict mode to validate HTML documents. In short, At run time, they validate whether all HTML tags are closed properly like in XMLs. Consider we have below code inside our HTML

<link rel="stylesheet" href="styles/main.css"/>

Once I run gulp build ( i used generator-gulp-angular), I noticed that, in the dist folder, the above HTML code becomes

<link rel="stylesheet" href="styles/main.css">

without the ‘/’ at the end which will be considered as unclosed tag.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
wattazoumcommented, Sep 17, 2017

While I agree with @jedmao regarding the HTML5 specs, sometimes reality catches us. I have the same problem with an application using XHTML. I found a workaround, using gulp-replace and a regexp :

gulp.src(mySrc)
.pipe(useref())
// match the 'non closing' link tag and close it
.pipe(gulpIf('cssimport.xhtml', replace(/(<link [^>]*)(?!\/)>/g, "$1 />") ))
0reactions
nelaturukcommented, Jul 17, 2017

+1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Web scraping URL contains </a> end tag at the end how to ...
Although I'm using plaintext to just scrape a text, it has </a> end tag. How can I remove it? php · html ...
Read more >
End Tag (/) removed from <link> · Issue #639 · gulpjs/gulp · GitHub
In short, At run time, they validate whether all HTML tags are closed properly like in XMLs. ... End Tag (/) removed from...
Read more >
Should the HTML link tag be self-closing or not? - Codecademy
Over at W3schools they say that it should be self-closed like this: But over here at Codeacademy the editor warns me about it...
Read more >
Tags used in HTML
HTML Tags. This is a list of tags used in the HTML language. Each tag starts with a tag opener (a less than...
Read more >
strip_tags - Manual - PHP
strip_tags — Strip HTML and PHP tags from a string ... "5.3.4 strip_tags() no longer strips self-closing XHTML tags unless the self-closing XHTML...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found