Michael Howell
3 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
18 additions and
2 deletions
-
lib/rules_inline/entity.mjs
-
test/fixtures/markdown-it/commonmark_extras.txt
|
|
@ -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) |
|
|
|
|
|
@ -740,3 +740,19 @@ Html in image description |
|
|
|
. |
|
|
|
<p><img src="image.png" alt="text <textarea> text"></p> |
|
|
|
. |
|
|
|
|
|
|
|
|
|
|
|
https://github.com/commonmark/commonmark.js/pull/279 |
|
|
|
|
|
|
|
. |
|
|
|
¶g; |
|
|
|
|
|
|
|
¶ |
|
|
|
|
|
|
|
¶ |
|
|
|
. |
|
|
|
<p>&parag;</p> |
|
|
|
<p>&para</p> |
|
|
|
<p>¶</p> |
|
|
|
. |
|
|
|
|
|
|
|