mirror of
https://github.com/Orc/discount.git
synced 2026-09-25 04:10:00 +03:00
don't allow zero-length tick sectons; don't pull a second character if mathhandler return false
This commit is contained in:
+8
-6
@@ -1344,10 +1344,12 @@ tickhandler(MMIOT *f, int tickchar, int minticks, int allow_space, spanhandler s
|
||||
tick = endticks;
|
||||
}
|
||||
|
||||
shift(f, tick);
|
||||
(*spanner)(f,size);
|
||||
shift(f, size+tick-1);
|
||||
return 1;
|
||||
if ( size > 0 ) {
|
||||
shift(f, tick);
|
||||
(*spanner)(f,size);
|
||||
shift(f, size+tick-1);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -1559,9 +1561,9 @@ text(MMIOT *f)
|
||||
case '$': if ( is_flag_set(&f->flags, MKD_LATEX) && !is_flag_set(&f->flags, MKD_STRICT) ) {
|
||||
if ( peek(f,1) == '$' ) {
|
||||
pull(f);
|
||||
if ( mathhandler(f, '$', '$') )
|
||||
if ( mathhandler(f, '$', '$') ) {
|
||||
break;
|
||||
pull(f);
|
||||
}
|
||||
Qchar('$', f);
|
||||
}
|
||||
else if ( tickhandler(f,c,1,1,LaTeXspan) )
|
||||
|
||||
Reference in New Issue
Block a user