Security News
CISA Brings KEV Data to GitHub
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
content-kit-compiler
Advanced tools
Parses and renders content to and from the JSON model that backs ContentKit's WYSIWYG Editor
Parses and renders content to and from the JSON model that backs ContentKit's WYSIWYG Editor
Parsing HTML:
<h2>My First Blog Post</h2>
<h3>The Subtitle</h3>
<p>This is a paragraph, with a <a href="http://google.com/">link</a> and some <b>formatting</b>.</p>
<img src="kittens.png" alt="Kittens"/>
<ul>
<li>Item A</li>
<li>Item B</li>
</ul>
var compiler = new ContentKit.Compiler();
var json = compiler.parse(html);
Output:
[
{
"type":2,
"value":"My First Blog Post",
"markup":[]
},
{
"type":3,
"value":"The Subtitle",
"markup":[]
},
{
"type":1,
"value":"This is a paragraph, with a link and some formatting.",
"markup":[
{
"start":28,
"end":32,
"type":4,
"attributes":{
"href":"http://google.com/"
}
},
{
"start":42,
"end":52,
"type":1
}
]
},
{
"type":4,
"value":"",
"markup":[],
"attributes":{
"src":"kittens.png",
"alt":"Kittens"
}
},
{
"type":6,
"value":"Item A Item B",
"markup":[
{
"start":0,
"end":6,
"type":6
},
{
"start":7,
"end":13,
"type":6
}
]
}
]
Rendering JSON to HTML:
var html = compiler.render(json);
Output:
<h2>My First Blog Post</h2><h3>The Subtitle</h3><p>This is a paragraph, with a <a href="http://google.com/">link</a> and some <b>formatting</b>.</p><img src="kittens.png" alt="Kittens"/><ul><li>Item A</li> <li>Item B</li></ul>
npm install
gulp
FAQs
Parses and renders content to and from the JSON model that backs ContentKit's WYSIWYG Editor
The npm package content-kit-compiler receives a total of 9 weekly downloads. As such, content-kit-compiler popularity was classified as not popular.
We found that content-kit-compiler demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.