Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New html tagging option #73

Closed
gustavoam-asdf opened this issue Feb 15, 2022 · 1 comment
Closed

New html tagging option #73

gustavoam-asdf opened this issue Feb 15, 2022 · 1 comment

Comments

@gustavoam-asdf
Copy link

An interesting new feature would be a new boolean option that when enabled allows you to add HTML tags with class names to the result.
For example:

const obj = {
  prop1: "prop1",
  prop2: "prop2",
  action1(){
    console.log("Obj action")
  }
}
console.log(stringify(obj, , { indent: "  ", singleQuotes: false, htmlTagging: true }))

Must print:

<span class="braces braces-open">{</span> 
  <span class="property-name">prop1:</span> <span class="property-value">"prop1"</span><span class="comma">,</span>
  <span class="property-name">prop2:</span> <span class="property-value">"prop2"</span><span class="comma">,</span>
  <span class="function-name">action1()</span><span class="braces braces-open">{</span><span class="function-content">
    console.log("Obj action")
  </span><span class="braces braces-open">}</span> 
<span class="braces braces-open">}</span>
@sindresorhus
Copy link
Member

That is out of scope for this package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants