Browse Source

Reduce maximum length for numeric html entities

This is no longer recognized as an entity, according to commonmark 0.29 tests:
�

See also:
026ca8234b
pull/570/head
Alex Kocharin 6 years ago
parent
commit
02a2605e84
  1. 2
      lib/rules_inline/entity.js
  2. 10
      test/fixtures/markdown-it/commonmark_extras.txt

2
lib/rules_inline/entity.js

@ -8,7 +8,7 @@ var isValidEntityCode = require('../common/utils').isValidEntityCode;
var fromCodePoint = require('../common/utils').fromCodePoint;
var DIGITAL_RE = /^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i;
var DIGITAL_RE = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i;
var NAMED_RE = /^&([a-z][a-z0-9]{1,31});/i;

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

@ -485,3 +485,13 @@ Coverage. Various tags not interrupting blockquotes because of indentation:
# not a heading</p>
</blockquote>
.
Coverage, entities with code > 10FFFF. Made this way for compatibility with commonmark.js.
.
&#x110000;
&#x1100000;
.
<p>�</p>
<p>&amp;#x1100000;</p>
.

Loading…
Cancel
Save