Skip to content

Commit fbab104

Browse files
authored
Merge pull request #52 from posthtml/milestone-0.5.2
Milestone 0.5.2
2 parents 16eaa69 + c8641cd commit fbab104

5 files changed

Lines changed: 18 additions & 5 deletions

File tree

changelog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1+
## <small>0.5.2 (2020-10-30)</small>
2+
3+
* 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)
4+
* 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)
5+
6+
7+
18
## <small>0.5.1 (2020-10-27)</small>
29

10+
* 0.5.1 ([b6b4a8b](https://github.com/posthtml/posthtml-parser/commit/b6b4a8b))
311
* 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)
412
* style: after lint ([23dd2a0](https://github.com/posthtml/posthtml-parser/commit/23dd2a0))
513
* build: change eslint to xo ([5233a43](https://github.com/posthtml/posthtml-parser/commit/5233a43))

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const {Parser} = require('htmlparser2');
33
/**
44
* @see https://github.com/fb55/htmlparser2/wiki/Parser-options
55
*/
6-
const defaultOptions = {lowerCaseTags: false, lowerCaseAttributeNames: false};
6+
const defaultOptions = {lowerCaseTags: false, lowerCaseAttributeNames: false, decodeEntities: false};
77

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

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "posthtml-parser",
3-
"version": "0.5.1",
3+
"version": "0.5.2",
44
"description": "Parse HTML/XML to PostHTMLTree",
55
"keywords": [
66
"html",

test/test.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ chai.use(require('sinon-chai'));
1010

1111
describe('PostHTML-Parser test', () => {
1212
describe('Call signatures', () => {
13-
const customOptions = {lowerCaseTags: false, lowerCaseAttributeNames: false};
13+
const customOptions = {lowerCaseTags: false, lowerCaseAttributeNames: false, decodeEntities: false};
1414
let MockedHtmlParser2;
1515
let parserSpy;
1616

@@ -229,4 +229,9 @@ describe('PostHTML-Parser test', () => {
229229
{tag: 'script', content: [' var str = \'hey <form\'; if (!str.match(new RegExp(\'<(form|iframe)\', \'g\'))) { /* ... */ }']}
230230
]);
231231
});
232+
233+
it('should be not converting html entity name', () => {
234+
const html = '&zwnj;&nbsp;&copy;';
235+
expect(parser(html)).to.eql(['&zwnj;&nbsp;&copy;']);
236+
});
232237
});

0 commit comments

Comments
 (0)