Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

posthtml-parser

Package Overview
Dependencies
Maintainers
3
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

posthtml-parser - npm Package Compare versions

Comparing version 0.4.1 to 0.4.2

.vscode/launch.json

5

index.js
'use strict';
var Parser = require('htmlparser2/lib/Parser');
var objectAssign = require('object-assign');

@@ -67,3 +66,3 @@ /**

obj[key] = attrs[key].replace(/"/g, '"');
objectAssign(result, obj);
Object.assign(result, obj);
});

@@ -134,3 +133,3 @@

function parser(html) {
var opt = objectAssign(defaultOptions, option);
var opt = Object.assign(defaultOptions, option);
return postHTMLParser(html, opt);

@@ -137,0 +136,0 @@ }

22

package.json
{
"name": "posthtml-parser",
"version": "0.4.1",
"version": "0.4.2",
"description": "Parse HTML/XML to PostHTMLTree",

@@ -13,5 +13,6 @@ "keywords": [

"main": "index.js",
"types": "index.d.ts",
"scripts": {
"test": "npm run lint && npm run coverage",
"lint": "jshint . && jscs -v .",
"lint": "jshint . && jscs .",
"coverage": "istanbul cover --report text --report html --report lcov node_modules/mocha/bin/_mocha",

@@ -29,15 +30,14 @@ "preversion": "npm test",

"dependencies": {
"htmlparser2": "^3.9.2",
"object-assign": "^4.1.1"
"htmlparser2": "^3.9.2"
},
"devDependencies": {
"chai": "^3.3.0",
"chai": "^4.2.0",
"istanbul": "^0.4.0",
"jscs": "^2.3.5",
"jshint": "^2.8.0",
"mocha": "^2.3.3",
"rewire": "^2.5.2",
"sinon": "^1.17.4",
"sinon-chai": "^2.8.0"
"jscs": "^3.0.7",
"jshint": "^2.10.3",
"mocha": "^6.2.2",
"rewire": "^4.0.1",
"sinon": "^7.5.0",
"sinon-chai": "^3.3.0"
}
}

@@ -49,3 +49,3 @@ # posthtml-parser

'\n ',
{
{
tag: 'span',

@@ -88,4 +88,34 @@ attrs: {

### `xmlMode`
Type: `Boolean`
Default: `false`
Description: *Indicates whether special tags (`<script>` and `<style>`) should get special treatment and if "empty" tags (eg. `<br>`) can have children. If false, the content of special tags will be text only. For feeds and other XML content (documents that don't consist of HTML), set this to true.*
### `decodeEntities`
Type: `Boolean`
Default: `false`
Description: *If set to true, entities within the document will be decoded.*
### `lowerCaseTags`
Type: `Boolean`
Default: `false`
Description: *If set to true, all tags will be lowercased. If `xmlMode` is disabled.*
### `lowerCaseAttributeNames`
Type: `Boolean`
Default: `false`
Description: *If set to true, all attribute names will be lowercased. This has noticeable impact on speed.*
### `recognizeCDATA`
Type: `Boolean`
Default: `false`
Description: *If set to true, CDATA sections will be recognized as text even if the `xmlMode` option is not enabled. NOTE: If `xmlMode` is set to `true` then CDATA sections will always be recognized as text.*
### `recognizeSelfClosing`
Type: `Boolean`
Default: `false`
Description: *If set to true, self-closing tags will trigger the `onclosetag` event even if `xmlMode` is not set to `true`. NOTE: If `xmlMode` is set to `true` then self-closing tags will always be recognized.*
## License
[MIT](LICENSE)

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc