mirror of
https://github.com/Orc/discount.git
synced 2026-09-25 04:10:00 +03:00
Rearrange the guts of maybe_tag_or_link to make it better reject
non-tag items.
This commit is contained in:
+4
-2
@@ -787,17 +787,19 @@ maybe_tag_or_link(MMIOT *f, int close)
|
||||
if ( size == 0 )
|
||||
return 0;
|
||||
|
||||
consume = ( close != EOF ) ? (size+1) : (size);
|
||||
|
||||
if ( maybetag || (size >= 3 && strncmp(cursor(f), "!--", 3) == 0) ) {
|
||||
Qstring(forbidden_tag(f) ? "<" : "<", f);
|
||||
while ( ((c = peek(f, 1)) != EOF) && (c != '>') )
|
||||
cputc(pull(f), f);
|
||||
return 1;
|
||||
}
|
||||
if ( close == '>' && isspace(c) )
|
||||
return 0;
|
||||
|
||||
if ( f->flags & DENY_A ) return 0;
|
||||
|
||||
consume = ( close != EOF ) ? (size+1) : (size);
|
||||
|
||||
text = cursor(f);
|
||||
shift(f, consume);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user