summaryrefslogtreecommitdiff
path: root/src/inlines.c
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-11-11 12:55:33 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2019-11-11 12:55:33 -0800
commit7b35d4bdc5e514ded03c0f0012983fe315a3aaf4 (patch)
tree8a5e6b25cac90d264ba492470ec70f31bc6ea7a5 /src/inlines.c
parentcb1cd888cce0cae20a33663d6d17ef7630c5d4d7 (diff)
Cleaner approach to max digits for numeric entities.
This modifies unescaping in houdini_html_u.c rather than the entity handling in inlines.c. Unlike the other, this approach works also in e.g. link titles.
Diffstat (limited to 'src/inlines.c')
-rw-r--r--src/inlines.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/inlines.c b/src/inlines.c
index 263a39b..6b77311 100644
--- a/src/inlines.c
+++ b/src/inlines.c
@@ -784,18 +784,13 @@ static cmark_node *handle_backslash(subject *subj) {
static cmark_node *handle_entity(subject *subj) {
cmark_strbuf ent = CMARK_BUF_INIT(subj->mem);
bufsize_t len;
- int length_limit = 256;
advance(subj);
len = houdini_unescape_ent(&ent, subj->input.data + subj->pos,
subj->input.len - subj->pos);
- if (peek_char(subj) == '#') {
- length_limit = 9; // includes #, optional x for hex, and ;
- }
-
- if (len <= 0 || len > length_limit)
+ if (len <= 0)
return make_str(subj, subj->pos - 1, subj->pos - 1, cmark_chunk_literal("&"));
subj->pos += len;