improperly closed textarea element unexpectedly slurps following content
See original GitHub issue🐛 Bug Report
Improper closing of <textarea> slurps up the rest of the content in the file (as opposed to adding a </textarea> tag and proceeding.
To Reproduce
Steps to reproduce the behavior: https://repl.it/repls/OnlyShabbyCgi
Paste your markup here:
<!doctype html>
<html class="no-js" lang="">
<body>
<p>Hello</p>
<textarea />
<p>World</p>
</body>
</html>
creates
<!doctype html>
<html class="no-js" lang="">
<body>
<p>Hello</p>
<textarea/>
</body>
</html>
and
<!doctype html>
<html class="no-js" lang="">
<body>
<p>Hello</p>
<textarea>
<p>World</p>
</body>
</html>
produces
<!doctype html>
<html class="no-js" lang="">
<body>
<p>Hello</p>
<textarea></textarea>
</body>
</html>
Expected behavior
keep the textarea element, close it, and keep following content, as browsers generally behave
Paste the results here:
<!doctype html>
<html class="no-js" lang="">
<body>
<p>Hello</p>
<textarea></textarea>
<p>World</p>
</body>
</html>
Context
- HTML5 only
Your Environment
- Prettyhtml version: 0.1.5
- NodeJs version: 9.7.1
- Environment name and version: repl.it
- Operating System and version: linux
Issue Analytics
- State:
- Created 5 years ago
- Comments:18 (13 by maintainers)
Top Results From Across the Web
Are (non-void) self-closing tags valid in HTML5?
According to the HTML5 spec, tags that cannot have any contents (known as void elements) can be self-closing*. This includes the following tags:...
Read more >Untitled
The HTML <a> element (or anchor element) creates a hyperlink to other web pages, files, locations within the same page, email addresses, or...
Read more >Coding with mod_perl in Mind - CiteSeerX
following code reads the contents of an entire file in one go: open IN, $file or die $!;. $/ = undef;. $content =...
Read more >Experience Cloud - Salesforce Implementation guides
After you create a site, Experience Workspaces is where you access Experience Builder, manage content, configure site settings, and.
Read more >The Textarea element - HTML: HyperText Markup Language
The <textarea> HTML element represents a multi-line plain-text editing ... Default content entered between the opening and closing tags.
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
@casey6 your proposal was implemented with https://github.com/Prettyhtml/prettyhtml/pull/56
@casey6 proposal is tracked here https://github.com/Prettyhtml/prettyhtml/issues/55