Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Commit

Permalink
Merge pull request #28 from fix/numerical-entities
Browse files Browse the repository at this point in the history
  • Loading branch information
rayd committed Jul 24, 2017
2 parents 17687fc + f437d90 commit e55ba39
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function transformName(name) {
}

// Regex for matching HTML entities.
const entityRegex = new RegExp('&[a-z0-9]+;', 'gi')
const entityRegex = new RegExp('&[a-z0-9#]+;', 'gi')
// Element for setting innerHTML for transforming entities.
let el = null;

Expand Down
4 changes: 2 additions & 2 deletions test/tests/strings_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ describe("#virtualizeString", () => {
});

it("should decode HTML entities, since VNodes just deal with text content", () => {
expect(virtualizeString("<div>&amp; is an ampersand! and &frac12; is 1/2!</div>")).to.deep.equal(
h('div', [ '& is an ampersand! and ½ is 1/2!' ])
expect(virtualizeString("<div>&amp; is an ampersand! and &frac12; is 1/2! and &#xA9; is copyright!</div>")).to.deep.equal(
h('div', [ '& is an ampersand! and ½ is 1/2! and © is copyright!' ])
);
expect(virtualizeString("<a href='http://example.com?test=true&amp;something=false'>Test</a>")).to.deep.equal(
h('a', {
Expand Down

0 comments on commit e55ba39

Please sign in to comment.