0.1.1 • Published 9 years ago

postxml-custom-tags v0.1.1

Weekly downloads
4
License
MIT
Repository
github
Last release
9 years ago

postxml-custom-tags

npm version

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

0.1.1

9 years ago

0.1.0

9 years ago