Fossil SCM
merge from trunk
Commit
5b2c83733628707e5318f24ed18fccf17e3f48b8
Parent
87e27419fd33979…
1 file changed
+4
-3
+4
-3
| --- src/wikiformat.c | ||
| +++ src/wikiformat.c | ||
| @@ -379,11 +379,10 @@ | ||
| 379 | 379 | static int r = -1; |
| 380 | 380 | if( r<0 ) r = db_get_boolean("wiki-use-html", 0); |
| 381 | 381 | return r; |
| 382 | 382 | } |
| 383 | 383 | |
| 384 | - | |
| 385 | 384 | /* |
| 386 | 385 | ** z points to a "<" character. Check to see if this is the start of |
| 387 | 386 | ** a valid markup. If it is, return the total number of characters in |
| 388 | 387 | ** the markup including the initial "<" and the terminating ">". If |
| 389 | 388 | ** it is not well-formed markup, return 0. |
| @@ -393,15 +392,17 @@ | ||
| 393 | 392 | int inparen = 0; |
| 394 | 393 | int c; |
| 395 | 394 | if( z[n]=='/' ){ n++; } |
| 396 | 395 | if( !isalpha(z[n]) ) return 0; |
| 397 | 396 | 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; | |
| 399 | 400 | while( (c = z[n])!=0 && (c!='>' || inparen) ){ |
| 400 | 401 | if( c==inparen ){ |
| 401 | 402 | inparen = 0; |
| 402 | - }else if( c=='"' || c=='\'' ){ | |
| 403 | + }else if( inparen==0 && (c=='"' || c=='\'') ){ | |
| 403 | 404 | inparen = c; |
| 404 | 405 | } |
| 405 | 406 | n++; |
| 406 | 407 | } |
| 407 | 408 | if( z[n]!='>' ) return 0; |
| 408 | 409 |
| --- 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 |