Browse Source

Merge 6dbfa308b8 into 0fe7ccb4b7

pull/1096/merge
Michael Howell 3 months ago
committed by GitHub
parent
commit
a19ef0f53d
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      lib/rules_inline/entity.mjs
  2. 16
      test/fixtures/markdown-it/commonmark_extras.txt

4
lib/rules_inline/entity.mjs

@ -1,6 +1,6 @@
// Process html entity - {, ¯, ", ...
import { decodeHTML } from 'entities'
import { decodeHTMLStrict } from 'entities'
import { isValidEntityCode, fromCodePoint } from '../common/utils.mjs'
const DIGITAL_RE = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i
@ -33,7 +33,7 @@ export default function entity (state, silent) {
} else {
const match = state.src.slice(pos).match(NAMED_RE)
if (match) {
const decoded = decodeHTML(match[0])
const decoded = decodeHTMLStrict(match[0])
if (decoded !== match[0]) {
if (!silent) {
const token = state.push('text_special', '', 0)

16
test/fixtures/markdown-it/commonmark_extras.txt

@ -740,3 +740,19 @@ Html in image description
.
<p><img src="image.png" alt="text &lt;textarea&gt; text"></p>
.
https://github.com/commonmark/commonmark.js/pull/279
.
&parag;
&para
&para;
.
<p>&amp;parag;</p>
<p>&amp;para</p>
<p>¶</p>
.

Loading…
Cancel
Save