1.0.24 • Published 6 years ago

htmltagdetector v1.0.24

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

HTMLTagDetection

Detect HTML Tags

Sample code

'use strict';


const fs = require('fs');
const path = require('path');
const readline = require('readline');
const stream = require('stream');
var  HtmlTagDetector = require('htmltagdetector');


var debug = true;
//var parser = new Parser({trim: true});


if (process.argv.length <= 3) {
	if( debug ) {
		console.log("Usage: node " + path.basename(__filename) + " <source of HTML file>" + " <target of js file>"+ " <output file>");
	}
    process.exit(-1);
}

var inputHtmlFile = process.argv[2];
var ruleJSFile = process.argv[3];
var outputfile = process.argv[4];

HtmlTagDetector.detectTags(inputHtmlFile, ruleJSFile, outputfile);

Rule File This file can be overrided and easily to chain custom rules

[

{"rulename":"titlerule", "tag":{"min":1,"name":"head", "tag":{"min":1,"name":"title", "text": "true"}}},
{"rulename":"metarule","tag":{"min":1,"name":"head", "tag":{"min":1,"name":"meta", "attribs": [{"name":"keywords"}]}}},
{"rulename":"metarule","tag":{"min":1,"name":"head", "tag":{"min":1,"name":"meta", "attribs": [{"name":"descriptions"}]}}},
{"rulename":"strongrule","tag":{"name":"strong", "min":15}},
{"rulename":"hrule","tag":{"name":"H1", "min":1}},
{"rulename":"imgrule","tag":{"min":1,"name":"img", "attribs":[{"alt":""}]}},
{"rulename":"arule","tag":{"min":1,"name":"a", "attribs":[{"rel":""}]}}

]
1.0.24

6 years ago

1.0.23

6 years ago

1.0.22

6 years ago

1.0.21

6 years ago

1.0.20

6 years ago

1.0.19

6 years ago

1.0.18

6 years ago

1.0.17

6 years ago

1.0.16

6 years ago

1.0.15

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago