Comparing version 1.3.1 to 1.3.2
@@ -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)) |
{ | ||
"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. | ||
####• TreeAdapters.default | ||
#### • TreeAdapters.default | ||
Default tree format for parse5. | ||
####• TreeAdapters.htmlparser2 | ||
#### • 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. | ||
####• Parser.ctor([treeAdapter]) | ||
#### • 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 @@ | ||
####• Parser.parse(html) | ||
#### • Parser.parse(html) | ||
Parses specified `html` string. Returns `document` node. | ||
@@ -102,3 +102,3 @@ | ||
####• Parser.parseFragment(htmlFragment, [contextElement]) | ||
#### • 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. | ||
####• SimpleApiParser.ctor(handlers) | ||
#### • 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 @@ | ||
####• SimpleApiParser.parse(html) | ||
#### • 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. | ||
####• Serializer.ctor([treeAdapter, options]) | ||
#### • 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 @@ | ||
####• Serializer.serialize(node) | ||
#### • 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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6370
384950