postxml-custom-tags
v0.1.1
Published
Postxml plugin anable using custom tags in html. It replace them with div elements.
Downloads
3
Readme
postxml-custom-tags
PostXML plugin anable using custom tags in html. It replace them with div elements.
Installation
npm i postxml-custom-tags --save-dev
Usage
var fs = require(fs),
postxml = require(postxml),
plugin = require(postxml-custom-tags);
var html = fs.readFileSync(input.html, utf8);
var output = postxml(
html,
[
plugin()
]
);
Example
Input
<custom class="b-block" ng-click="init = 2">Text</custom>
Output
<div class="b-block" ng-click="init = 2">Text</div>
options
src
Type: string
Default: undefined
Description: set tag for replacement of tags with "src" (except audio, frame, iframe, img, input, layer, script, textarea, video
)
Example:
var fs = require(fs),
postxml = require(postxml),
plugin = require(postxml-custom-tags);
var html = fs.readFileSync(input.html, utf8);
var output = postxml(
html,
[
plugin({
src: 'img'
})
]
);
/*Input*/
<image src="image.png"></image>
/*Output*/
<img src="image.png">
href
Type: string
Default: undefined
Description: set tag for replacement of tags with "href" (except a, area, base, link
)
Example:
var fs = require(fs),
postxml = require(postxml),
plugin = require(postxml-custom-tags);
var html = fs.readFileSync(input.html, utf8);
var output = postxml(
html,
[
plugin({
href: 'a'
})
]
);
/*Input*/
<div href="#"></div>
/*Output*/
<a href="#"></a>
Licence
MIT