Fossil SCM

merge from trunk

Ratte 2010-09-26 11:34 wolfgangFormat2CSS_2 merge
Commit 5b2c83733628707e5318f24ed18fccf17e3f48b8
1 file changed +4 -3
--- src/wikiformat.c
+++ src/wikiformat.c
@@ -379,11 +379,10 @@
379379
static int r = -1;
380380
if( r<0 ) r = db_get_boolean("wiki-use-html", 0);
381381
return r;
382382
}
383383
384
-
385384
/*
386385
** z points to a "<" character. Check to see if this is the start of
387386
** a valid markup. If it is, return the total number of characters in
388387
** the markup including the initial "<" and the terminating ">". If
389388
** it is not well-formed markup, return 0.
@@ -393,15 +392,17 @@
393392
int inparen = 0;
394393
int c;
395394
if( z[n]=='/' ){ n++; }
396395
if( !isalpha(z[n]) ) return 0;
397396
while( isalnum(z[n]) ){ n++; }
398
- if( (c = z[n])!='>' && !isspace(c) ) return 0;
397
+ c = z[n];
398
+ if( c=='/' && z[n+1]=='>' ){ return n+2; }
399
+ if( c!='>' && !isspace(c) ) return 0;
399400
while( (c = z[n])!=0 && (c!='>' || inparen) ){
400401
if( c==inparen ){
401402
inparen = 0;
402
- }else if( c=='"' || c=='\'' ){
403
+ }else if( inparen==0 && (c=='"' || c=='\'') ){
403404
inparen = c;
404405
}
405406
n++;
406407
}
407408
if( z[n]!='>' ) return 0;
408409
--- src/wikiformat.c
+++ src/wikiformat.c
@@ -379,11 +379,10 @@
379 static int r = -1;
380 if( r<0 ) r = db_get_boolean("wiki-use-html", 0);
381 return r;
382 }
383
384
385 /*
386 ** z points to a "<" character. Check to see if this is the start of
387 ** a valid markup. If it is, return the total number of characters in
388 ** the markup including the initial "<" and the terminating ">". If
389 ** it is not well-formed markup, return 0.
@@ -393,15 +392,17 @@
393 int inparen = 0;
394 int c;
395 if( z[n]=='/' ){ n++; }
396 if( !isalpha(z[n]) ) return 0;
397 while( isalnum(z[n]) ){ n++; }
398 if( (c = z[n])!='>' && !isspace(c) ) return 0;
 
 
399 while( (c = z[n])!=0 && (c!='>' || inparen) ){
400 if( c==inparen ){
401 inparen = 0;
402 }else if( c=='"' || c=='\'' ){
403 inparen = c;
404 }
405 n++;
406 }
407 if( z[n]!='>' ) return 0;
408
--- src/wikiformat.c
+++ src/wikiformat.c
@@ -379,11 +379,10 @@
379 static int r = -1;
380 if( r<0 ) r = db_get_boolean("wiki-use-html", 0);
381 return r;
382 }
383
 
384 /*
385 ** z points to a "<" character. Check to see if this is the start of
386 ** a valid markup. If it is, return the total number of characters in
387 ** the markup including the initial "<" and the terminating ">". If
388 ** it is not well-formed markup, return 0.
@@ -393,15 +392,17 @@
392 int inparen = 0;
393 int c;
394 if( z[n]=='/' ){ n++; }
395 if( !isalpha(z[n]) ) return 0;
396 while( isalnum(z[n]) ){ n++; }
397 c = z[n];
398 if( c=='/' && z[n+1]=='>' ){ return n+2; }
399 if( c!='>' && !isspace(c) ) return 0;
400 while( (c = z[n])!=0 && (c!='>' || inparen) ){
401 if( c==inparen ){
402 inparen = 0;
403 }else if( inparen==0 && (c=='"' || c=='\'') ){
404 inparen = c;
405 }
406 n++;
407 }
408 if( z[n]!='>' ) return 0;
409

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button