Fossil SCM

Fix the printf() %W and %!W conversions so that they can both be used during the same Fossil run.

drh 2025-03-03 23:23 trunk
Commit adbb0b9255e36fc0cfe0f9019bd4dac5d4da3b56c0b42348cd1d3d00d63ccd9c
1 file changed +8 -2
+8 -2
--- src/printf.c
+++ src/printf.c
@@ -253,11 +253,11 @@
253253
** is acceptable even if the "timeline-block-markup" setting is false.
254254
*/
255255
static int wiki_convert_flags(int altForm2){
256256
static int wikiFlags = 0;
257257
if( wikiFlags==0 ){
258
- if( altForm2 || db_get_boolean("timeline-block-markup", 0) ){
258
+ if( db_get_boolean("timeline-block-markup", 0) ){
259259
wikiFlags = WIKI_INLINE | WIKI_NOBADLINKS;
260260
}else{
261261
wikiFlags = WIKI_INLINE | WIKI_NOBLOCK | WIKI_NOBADLINKS;
262262
}
263263
if( db_get_boolean("timeline-plaintext", 0) ){
@@ -265,11 +265,17 @@
265265
}
266266
if( db_get_boolean("timeline-hard-newlines", 0) ){
267267
wikiFlags |= WIKI_NEWLINE;
268268
}
269269
}
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
+ }
271277
}
272278
273279
274280
275281
/*
276282
--- 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

Keyboard Shortcuts

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