Html2jsonml
Convert HTML to JSONML
Install / Use
/learn @Maqentaer/Html2jsonmlREADME
#html2jsonml
Convert HTML to JSONML
##Usage
var jsonMl = html2jsonml( <string> html [, <object> options ] [, <func> callback(err, <array> jsonMl)]);
##Options for supporting not JSONML standards and others parser options:
var options = {
// Add attributes object in any case (false by default):
requireAttributes: false,
// Children in separate array (false by default):
childrenInArray: false,
// Don't generate processing instructions (false by default):
noProcessingInstructions: false,
// HtmlParser2 (false by default):
lowerCaseAttributeNames: false,
// HtmlParser2 (false by default):
lowerCaseTags: false,
// HtmlParser2:Tokenizer (false by default):
decodeEntities: false
}
##Examples
var html2jsonml = require('html2jsonml');
html2jsonml("<div id='first'>text</div>", function(err, jsonMl){
if(err) throw err;
else console.log(JSON.stringify(jsonMl));
});
var html2jsonml = require('html2jsonml');
var jsonMl = html2jsonml("<div id='first'>text</div>");
if(null === jsonMl) throw new Error("Invalid HTML");
else console.log(JSON.stringify(jsonMl));
##Installation
npm install html2jsonml
Contributors
- Maqentaer
MIT Licenced
Related Skills
node-connect
351.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
351.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
351.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
