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

html.prettyPrint does not do any indenting or line-breaking (Node 6.1.0)

Open
#10 3 comments 1 reaction 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

System specs:

  • Node: 6.1.0
  • OSX: 10.11.5

I haven't had any luck with this:

var html = require('html');
var txt = '<h2><strong><a href="http://awesome.com">AwesomeCom</a></strong><span>is awesome</span></h2>';
html.prettyPrint(txt, {indent_size: 2});
// result
'<h2><strong><a href="http://awesome.com">AwesomeCom</a></strong><span>is awesome</span></h2>'

So I tried the command-line example in the README but got the same, unformatted text.

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 by reproducing the Node 6.1.0 example from the issue and the command-line example in the README, then trace the html.prettyPrint entry point. Compare both results with the expected indented and line-broken output for the sample HTML; done means the API and CLI no longer return the original unformatted string.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.