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.

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:closed
  • Created 5 years ago
  • Comments:18 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
StarpTechcommented, Oct 26, 2018

@casey6 your proposal was implemented with https://github.com/Prettyhtml/prettyhtml/pull/56

0reactions
StarpTechcommented, Oct 25, 2018
Read more comments on GitHub >

github_iconTop 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 >

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