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.7.1 to 0.7.2

8

changelog.md

@@ -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 @@

2

package.json
{
"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>');

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