Socket
Socket
Sign inDemoInstall

parse5

Package Overview
Dependencies
0
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.3.1 to 1.3.2

3

CHANGELOG.md

@@ -0,1 +1,4 @@

## 1.3.2
* Fix: `<form>` processing in `<template>` (GH [#40](https://github.com/inikulin/parse5/issues/40))
## 1.3.1

@@ -2,0 +5,0 @@ * Fix: text node in `<template>` serialization problem with custom tree adapter (GH [#38](https://github.com/inikulin/parse5/issues/38))

2

package.json
{
"name": "parse5",
"description": "WHATWG HTML5 specification-compliant, fast and ready for production HTML parsing/serialization toolset for Node.",
"version": "1.3.1",
"version": "1.3.2",
"author": "Ivan Nikulin <ifaaan@gmail.com> (https://github.com/inikulin)",

@@ -6,0 +6,0 @@ "contributors": [

@@ -17,3 +17,3 @@ <p align="center">

##Install
## Install
```

@@ -24,3 +24,3 @@ $ npm install parse5

##Usage
## Usage
```js

@@ -40,3 +40,3 @@ var Parser = require('parse5').Parser;

##Is it fast?
## Is it fast?
Check out [this benchmark](https://github.com/inikulin/node-html-parser-bench).

@@ -56,12 +56,12 @@

##API reference
## API reference
###Enum: TreeAdapters
### Enum: TreeAdapters
Provides built-in tree adapters which can be passed as an optional argument to the `Parser` and `Serializer` constructors.
####&bull; TreeAdapters.default
#### &bull; TreeAdapters.default
Default tree format for parse5.
####&bull; TreeAdapters.htmlparser2
#### &bull; TreeAdapters.htmlparser2
Quite popular [htmlparser2](https://github.com/fb55/htmlparser2) tree format (e.g. used in [cheerio](https://github.com/MatthewMueller/cheerio) and [jsdom](https://github.com/tmpvar/jsdom)).

@@ -72,6 +72,6 @@

###Class: Parser
### Class: Parser
Provides HTML parsing functionality.
####&bull; Parser.ctor([treeAdapter])
#### &bull; Parser.ctor([treeAdapter])
Creates new reusable instance of the `Parser`. Optional `treeAdapter` argument specifies resulting tree format. If `treeAdapter` argument is not specified, `default` tree adapter will be used.

@@ -92,3 +92,3 @@

####&bull; Parser.parse(html)
#### &bull; Parser.parse(html)
Parses specified `html` string. Returns `document` node.

@@ -102,3 +102,3 @@

####&bull; Parser.parseFragment(htmlFragment, [contextElement])
#### &bull; Parser.parseFragment(htmlFragment, [contextElement])
Parses given `htmlFragment`. Returns `documentFragment` node. Optional `contextElement` argument specifies context in which given `htmlFragment` will be parsed (consider it as setting `contextElement.innerHTML` property). If `contextElement` argument is not specified then `<template>` element will be used as a context and fragment will be parsed in 'forgiving' manner.

@@ -117,6 +117,6 @@

###Class: SimpleApiParser
### Class: SimpleApiParser
Provides [SAX](https://en.wikipedia.org/wiki/Simple_API_for_XML)-style HTML parsing functionality.
####&bull; SimpleApiParser.ctor(handlers)
#### &bull; SimpleApiParser.ctor(handlers)
Creates new reusable instance of the `SimpleApiParser`. `handlers` argument specifies object that contains parser's event handlers. Possible events and their signatures are shown in the example.

@@ -151,3 +151,3 @@

####&bull; SimpleApiParser.parse(html)
#### &bull; SimpleApiParser.parse(html)
Raises parser events for the given `html`.

@@ -170,7 +170,7 @@

###Class: Serializer
### Class: Serializer
Provides tree-to-HTML serialization functionality.
**Note:** prior to v1.2.0 this class was called `TreeSerializer`. However, it's still accessible as `parse5.TreeSerializer` for backward compatibility.
####&bull; Serializer.ctor([treeAdapter, options])
#### &bull; Serializer.ctor([treeAdapter, options])
Creates new reusable instance of the `Serializer`. Optional `treeAdapter` argument specifies input tree format. If `treeAdapter` argument is not specified, `default` tree adapter will be used.

@@ -195,3 +195,3 @@

####&bull; Serializer.serialize(node)
#### &bull; Serializer.serialize(node)
Serializes the given `node`. Returns HTML string.

@@ -213,3 +213,3 @@

##Testing
## Testing
Test data is adopted from [html5lib project](https://github.com/html5lib). Parser is covered by more than 8000 test cases.

@@ -222,3 +222,3 @@ To run tests:

##Custom tree adapter
## Custom tree adapter
You can create a custom tree adapter so parse5 can work with your own DOM-tree implementation.

@@ -241,7 +241,7 @@ Just pass your adapter implementation to the parser's constructor as an argument:

##Questions or suggestions?
## Questions or suggestions?
If you have any questions, please feel free to create an issue [here on github](https://github.com/inikulin/parse5/issues).
##Author
## Author
[Ivan Nikulin](https://github.com/inikulin) (ifaaan@gmail.com)

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc