posthtml-parser
Advanced tools
Comparing version 0.7.1 to 0.7.2
@@ -0,3 +1,11 @@ | ||
## <small>0.7.2 (2021-04-12)</small> | ||
* fix: correctly parse text content after comments ([818e2f5](https://github.com/posthtml/posthtml-parser/commit/818e2f5)) | ||
* build(deps): bump y18n from 4.0.0 to 4.0.1 ([6b52ac1](https://github.com/posthtml/posthtml-parser/commit/6b52ac1)) | ||
## <small>0.7.1 (2021-02-15)</small> | ||
* 0.7.1 ([86a7954](https://github.com/posthtml/posthtml-parser/commit/86a7954)) | ||
* perf: tag name type ([60ec0c1](https://github.com/posthtml/posthtml-parser/commit/60ec0c1)) | ||
@@ -4,0 +12,0 @@ |
{ | ||
"name": "posthtml-parser", | ||
"version": "0.7.1", | ||
"version": "0.7.2", | ||
"description": "Parse HTML/XML to PostHTMLTree", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -71,3 +71,3 @@ import test from 'ava'; | ||
test('should be parse comment in content', t => { | ||
test('should be parse isolated comment', t => { | ||
const tree = parser('<div><!--comment--></div>'); | ||
@@ -78,2 +78,20 @@ const expected = [{tag: 'div', content: ['<!--comment-->']}]; | ||
test('should be parse comment before text content', t => { | ||
const tree = parser('<div><!--comment-->Text after comment</div>'); | ||
const expected = [{tag: 'div', content: ['<!--comment-->', 'Text after comment']}]; | ||
t.deepEqual(tree, expected); | ||
}); | ||
test('should be parse comment after text content', t => { | ||
const tree = parser('<div>Text before comment.<!--comment--></div>'); | ||
const expected = [{tag: 'div', content: ['Text before comment.', '<!--comment-->']}]; | ||
t.deepEqual(tree, expected); | ||
}); | ||
test('should be parse comment in the middle of text content', t => { | ||
const tree = parser('<div>Text surrounding <!--comment--> a comment.</div>'); | ||
const expected = [{tag: 'div', content: ['Text surrounding ', '<!--comment-->', ' a comment.']}]; | ||
t.deepEqual(tree, expected); | ||
}); | ||
test('should be parse doctype', t => { | ||
@@ -80,0 +98,0 @@ const tree = parser('<!doctype html>'); |
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
34103
273