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