max-mapper / max-mapper/commonjs-html-prettyprinter

Meaningful textarea whitespace removed

Open
#15 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
76
Forks
19
PR merge metrics
No merged PRs in 30d

Description

Hi!

First, thanks for the lib, it's super useful 👍

I've spotted a bug with the handling of <textarea> content whitespace, where it's removed by prettyPrint:

require('html').prettyPrint('<textarea>     hello    </textarea>')

Results in:

<textarea>hello</textarea>

The whitespace inside a <textarea> is semantic and removing it changes the meaning of the <textarea>.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the provided prettyPrint('<textarea> hello </textarea>') example and trace how textarea content whitespace is handled. Add regression coverage showing that the meaningful spaces remain intact; done when prettyPrint no longer changes the whitespace inside textarea content.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.