mirror of
https://github.com/Orc/discount.git
synced 2026-09-25 04:10:00 +03:00
Redo the superscript and relaxed emphasis flags into
NOSUPERSCRIPT and NORELAXED, so the default is to have them turned on and you need to turn them off (or do STRICT) explicitly.
This commit is contained in:
+6
-6
@@ -1137,9 +1137,9 @@ text(MMIOT *f)
|
||||
Qchar(c, f);
|
||||
break;
|
||||
/* A^B -> A<sup>B</sup> */
|
||||
case '^': if ( !(f->flags & MKD_SUPERSCRIPT) ||
|
||||
(f->flags & (STRICT|INSIDE_TAG)) || isthisspace(f,-1)
|
||||
|| isthisspace(f,1) )
|
||||
case '^': if ( (f->flags & (MKD_NOSUPERSCRIPT|STRICT|INSIDE_TAG))
|
||||
|| isthisspace(f,-1)
|
||||
|| isthisspace(f,1) )
|
||||
Qchar(c,f);
|
||||
else {
|
||||
char *sup = cursor(f);
|
||||
@@ -1155,9 +1155,9 @@ text(MMIOT *f)
|
||||
break;
|
||||
case '_':
|
||||
/* Underscores don't count if they're in the middle of a word */
|
||||
if ( (f->flags & MKD_RELAXED) && !(f->flags & STRICT)
|
||||
&& isthisalnum(f,-1)
|
||||
&& isthisalnum(f,1) ) {
|
||||
if ( (f->flags & (MKD_NORELAXED|STRICT))
|
||||
&& isthisalnum(f,-1)
|
||||
&& isthisalnum(f,1) ) {
|
||||
Qchar(c, f);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -58,6 +58,8 @@ static struct {
|
||||
{ "safelink",0, MKD_SAFELINK },
|
||||
{ "del", 1, MKD_NOSTRIKETHROUGH },
|
||||
{ "strikethrough", 1, MKD_NOSTRIKETHROUGH },
|
||||
{ "superscript", 1, MKD_NOSUPERSCRIPT },
|
||||
{ "emphasis", 0, MKD_NORELAXED },
|
||||
{ "1.0", 0, MKD_1_COMPAT },
|
||||
} ;
|
||||
|
||||
|
||||
+2
-2
@@ -85,8 +85,8 @@ typedef struct mmiot {
|
||||
#define INSIDE_TAG 0x00000020
|
||||
#define NO_PSEUDO_PROTO 0x00000040
|
||||
#define CDATA_OUTPUT 0x00000080
|
||||
#define MKD_SUPERSCRIPT 0x00000100
|
||||
#define MKD_RELAXED 0x00000200
|
||||
#define MKD_NOSUPERSCRIPT 0x00000100
|
||||
#define MKD_NORELAXED 0x00000200
|
||||
#define NOTABLES 0x00000400
|
||||
#define NOSTRIKETHROUGH 0x00000800
|
||||
#define TOC 0x00001000
|
||||
|
||||
Reference in New Issue
Block a user