🐛 Tags that do not belong to HTML should be ignored
See original GitHub issueFor services rendered as the template file, the template engine <%%>
,{{}}
marker package should be ignored, but the label disrupted
💻 Demo Code
<!DOCTYPE html>
<html>
<head>
<title><%=title%></title>
<link href="./style.css">
</head>
<body>
<h1>Welcome : </h1>
<% if(data){ %>
<p><%=data%></p>
<%}else{%>
<p><%=request.session._flash||' Error '%></p>
<%}%>
</body>
<script src="./index.js"></script>
</html>
🤔 Expected Behavior
<!DOCTYPE html> <html> <head> <title><%=title%></title> <link href="/dist/1fb0a95e00274611850900f80a9d9d1e.css"> </head> <body> <h1>Welcome : </h1> <% if(data){ %> <p><%=data%></p> <%}else{%> <p><%=request.session._flash||' Error ' %></p> <%}%> </body> <script src="/dist/e2e07bfc7be96fd730ba9a0cd2160e84.js"></script> </html>
😯 Current Behavior
<!DOCTYPE html> <html> <head> <title><%=title%></%=title%></title> <link href="/dist/1fb0a95e00274611850900f80a9d9d1e.css"> </head> <body> <h1>Welcome : </h1> <% if(data){="" %=""> <p><%=data%></%=data%></p> <%}else{%> <p><%=request.session._flash||' Error="" '%=""></%=request.session._flash||'></p> <%}%> </%}%></%}else{%></%></body> <script src="/dist/e2e07bfc7be96fd730ba9a0cd2160e84.js"></script> </html>
💁 Possible Solution
parcel build test/demo.html -d ./test/dist/ --mangle-tag=<%%>,{{}}
🌍 My Environment
Software | Version(s) |
---|---|
Parcel | 1.4.1 |
Node | v8.8.0 |
npm/Yarn | Yarn |
Operating System | MacOS 10.12.6 |
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:12 (7 by maintainers)
Top Results From Across the Web
Why are HTML tags silently ignored? - Meta Stack Exchange
What is the reasoning behind silently ignoring them? This would lead to users pasting in unformatted code and getting away with it.
Read more >Chrome ignores label when it contains a strong element
It appears this is a bug with Chrome after discussions with OP and testing. Do not use <strong> , <em> etc. within labels,...
Read more >8 The HTML syntax — HTML5 - W3C
The start and end tags of certain normal elements can be omitted, as described later. Those that cannot be omitted must not be...
Read more >WebD2: Common HTML Tags - University of Washington
Tags in HTML are not case sensitive, but in XHTML all tags must be in lower case. Even when coding in HTML, ......
Read more >95394 - The generic lang= attribute of HTML tags is ignored ...
The translate feature for chromium should follow the content-language tag before attempting to guess the language of the webpage.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
No, we should (if we want use parcel). The thing is there’re not only frontend things. For example now I’m developing small golang project with html templates (just to test one thing). So, since it small I don’t want to use something like gulp or webpack, but anyway I want to have compressed assets. Golang html templates is html with
{{ . . . }}
blocks. So, parcel can’t parse it. But since gotemplates is backend templating I can’t run it through the template engine first.Awesome work @maciej-ka , hope they merge it soonish 😃