Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
## <small>0.5.2 (2020-10-30)</small>

* fix: converting html entity name, close #51 ([4a8be73](https://github.com/posthtml/posthtml-parser/commit/4a8be73)), closes [#51](https://github.com/posthtml/posthtml-parser/issues/51)
* test: converting html entity name, issue #51 ([6bd5975](https://github.com/posthtml/posthtml-parser/commit/6bd5975)), closes [#51](https://github.com/posthtml/posthtml-parser/issues/51)



## <small>0.5.1 (2020-10-27)</small>

* 0.5.1 ([b6b4a8b](https://github.com/posthtml/posthtml-parser/commit/b6b4a8b))
* style: 2 space, close issue #33 ([cdd7dbd](https://github.com/posthtml/posthtml-parser/commit/cdd7dbd)), closes [#33](https://github.com/posthtml/posthtml-parser/issues/33)
* style: after lint ([23dd2a0](https://github.com/posthtml/posthtml-parser/commit/23dd2a0))
* build: change eslint to xo ([5233a43](https://github.com/posthtml/posthtml-parser/commit/5233a43))
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const {Parser} = require('htmlparser2');
/**
* @see https://github.com/fb55/htmlparser2/wiki/Parser-options
*/
const defaultOptions = {lowerCaseTags: false, lowerCaseAttributeNames: false};
const defaultOptions = {lowerCaseTags: false, lowerCaseAttributeNames: false, decodeEntities: false};

const defaultDirectives = [{name: '!doctype', start: '<', end: '>'}];

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "posthtml-parser",
"version": "0.5.1",
"version": "0.5.2",
"description": "Parse HTML/XML to PostHTMLTree",
"keywords": [
"html",
Expand Down
7 changes: 6 additions & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ chai.use(require('sinon-chai'));

describe('PostHTML-Parser test', () => {
describe('Call signatures', () => {
const customOptions = {lowerCaseTags: false, lowerCaseAttributeNames: false};
const customOptions = {lowerCaseTags: false, lowerCaseAttributeNames: false, decodeEntities: false};
let MockedHtmlParser2;
let parserSpy;

Expand Down Expand Up @@ -229,4 +229,9 @@ describe('PostHTML-Parser test', () => {
{tag: 'script', content: [' var str = \'hey <form\'; if (!str.match(new RegExp(\'<(form|iframe)\', \'g\'))) { /* ... */ }']}
]);
});

it('should be not converting html entity name', () => {
const html = '&zwnj;&nbsp;&copy;';
expect(parser(html)).to.eql(['&zwnj;&nbsp;&copy;']);
});
});