Fossil SCM
Fix the printf() %W and %!W conversions so that they can both be used during the same Fossil run.
Commit
adbb0b9255e36fc0cfe0f9019bd4dac5d4da3b56c0b42348cd1d3d00d63ccd9c
Parent
c32f97e9e49cc19…
1 file changed
+8
-2
+8
-2
| --- src/printf.c | ||
| +++ src/printf.c | ||
| @@ -253,11 +253,11 @@ | ||
| 253 | 253 | ** is acceptable even if the "timeline-block-markup" setting is false. |
| 254 | 254 | */ |
| 255 | 255 | static int wiki_convert_flags(int altForm2){ |
| 256 | 256 | static int wikiFlags = 0; |
| 257 | 257 | if( wikiFlags==0 ){ |
| 258 | - if( altForm2 || db_get_boolean("timeline-block-markup", 0) ){ | |
| 258 | + if( db_get_boolean("timeline-block-markup", 0) ){ | |
| 259 | 259 | wikiFlags = WIKI_INLINE | WIKI_NOBADLINKS; |
| 260 | 260 | }else{ |
| 261 | 261 | wikiFlags = WIKI_INLINE | WIKI_NOBLOCK | WIKI_NOBADLINKS; |
| 262 | 262 | } |
| 263 | 263 | if( db_get_boolean("timeline-plaintext", 0) ){ |
| @@ -265,11 +265,17 @@ | ||
| 265 | 265 | } |
| 266 | 266 | if( db_get_boolean("timeline-hard-newlines", 0) ){ |
| 267 | 267 | wikiFlags |= WIKI_NEWLINE; |
| 268 | 268 | } |
| 269 | 269 | } |
| 270 | - return wikiFlags; | |
| 270 | + if( altForm2 ){ | |
| 271 | + /* block markup (ex: <p>, <table>) allowed */ | |
| 272 | + return wikiFlags & ~WIKI_NOBLOCK; | |
| 273 | + }else{ | |
| 274 | + /* Do not allow any block format. Everything in a <span> */ | |
| 275 | + return wikiFlags; | |
| 276 | + } | |
| 271 | 277 | } |
| 272 | 278 | |
| 273 | 279 | |
| 274 | 280 | |
| 275 | 281 | /* |
| 276 | 282 |
| --- src/printf.c | |
| +++ src/printf.c | |
| @@ -253,11 +253,11 @@ | |
| 253 | ** is acceptable even if the "timeline-block-markup" setting is false. |
| 254 | */ |
| 255 | static int wiki_convert_flags(int altForm2){ |
| 256 | static int wikiFlags = 0; |
| 257 | if( wikiFlags==0 ){ |
| 258 | if( altForm2 || db_get_boolean("timeline-block-markup", 0) ){ |
| 259 | wikiFlags = WIKI_INLINE | WIKI_NOBADLINKS; |
| 260 | }else{ |
| 261 | wikiFlags = WIKI_INLINE | WIKI_NOBLOCK | WIKI_NOBADLINKS; |
| 262 | } |
| 263 | if( db_get_boolean("timeline-plaintext", 0) ){ |
| @@ -265,11 +265,17 @@ | |
| 265 | } |
| 266 | if( db_get_boolean("timeline-hard-newlines", 0) ){ |
| 267 | wikiFlags |= WIKI_NEWLINE; |
| 268 | } |
| 269 | } |
| 270 | return wikiFlags; |
| 271 | } |
| 272 | |
| 273 | |
| 274 | |
| 275 | /* |
| 276 |
| --- src/printf.c | |
| +++ src/printf.c | |
| @@ -253,11 +253,11 @@ | |
| 253 | ** is acceptable even if the "timeline-block-markup" setting is false. |
| 254 | */ |
| 255 | static int wiki_convert_flags(int altForm2){ |
| 256 | static int wikiFlags = 0; |
| 257 | if( wikiFlags==0 ){ |
| 258 | if( db_get_boolean("timeline-block-markup", 0) ){ |
| 259 | wikiFlags = WIKI_INLINE | WIKI_NOBADLINKS; |
| 260 | }else{ |
| 261 | wikiFlags = WIKI_INLINE | WIKI_NOBLOCK | WIKI_NOBADLINKS; |
| 262 | } |
| 263 | if( db_get_boolean("timeline-plaintext", 0) ){ |
| @@ -265,11 +265,17 @@ | |
| 265 | } |
| 266 | if( db_get_boolean("timeline-hard-newlines", 0) ){ |
| 267 | wikiFlags |= WIKI_NEWLINE; |
| 268 | } |
| 269 | } |
| 270 | if( altForm2 ){ |
| 271 | /* block markup (ex: <p>, <table>) allowed */ |
| 272 | return wikiFlags & ~WIKI_NOBLOCK; |
| 273 | }else{ |
| 274 | /* Do not allow any block format. Everything in a <span> */ |
| 275 | return wikiFlags; |
| 276 | } |
| 277 | } |
| 278 | |
| 279 | |
| 280 | |
| 281 | /* |
| 282 |