Skip to content

Commit

Permalink
Ignore case when comparing element names against blacklist
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyward committed May 14, 2019
1 parent 235c91a commit 024d45a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions index.compiler.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2405,6 +2405,18 @@ $25
new Date();
</script>
`);
});

it('does not parse the inside of <SCRIPT> blocks', () => {
render(compiler(['<SCRIPT>', ' new Date();', '</SCRIPT>'].join('\n')));

expect(root.innerHTML).toMatchInlineSnapshot(`
<script data-reactroot>
new Date();
</script>
`);
});

Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@ export function compiler(markdown, options) {
: parseInline;

const noInnerParse =
DO_NOT_PROCESS_HTML_ELEMENTS.indexOf(capture[1]) !== -1;
DO_NOT_PROCESS_HTML_ELEMENTS.indexOf(capture[1].toLowerCase()) !== -1;

return {
attrs: attrStringToMap(capture[2]),
Expand Down

0 comments on commit 024d45a

Please sign in to comment.