Fossil SCM

Fix the markdown converter so that it recognizes HTML comments and passes them through into the raw_html_tag callback.

drh 2020-09-15 15:43 trunk
Commit 881f86645a8d2abe6adad520c478dd711d5636643d86f64f7d015e87309bf0e0
1 file changed +4
--- src/markdown.c
+++ src/markdown.c
@@ -370,10 +370,14 @@
370370
371371
/* begins with a '<' optionally followed by '/', followed by letter */
372372
if( data[0]!='<' ) return 0;
373373
i = (data[1]=='/') ? 2 : 1;
374374
if( (data[i]<'a' || data[i]>'z') && (data[i]<'A' || data[i]>'Z') ){
375
+ if( data[1]=='!' && size>=7 && data[2]=='-' && data[3]=='-' ){
376
+ for(i=6; i<size && (data[i]!='>'||data[i-1]!='-'|| data[i-2]!='-');i++){}
377
+ if( i<size ) return i;
378
+ }
375379
return 0;
376380
}
377381
378382
/* scheme test */
379383
*autolink = MKDA_NOT_AUTOLINK;
380384
--- src/markdown.c
+++ src/markdown.c
@@ -370,10 +370,14 @@
370
371 /* begins with a '<' optionally followed by '/', followed by letter */
372 if( data[0]!='<' ) return 0;
373 i = (data[1]=='/') ? 2 : 1;
374 if( (data[i]<'a' || data[i]>'z') && (data[i]<'A' || data[i]>'Z') ){
 
 
 
 
375 return 0;
376 }
377
378 /* scheme test */
379 *autolink = MKDA_NOT_AUTOLINK;
380
--- src/markdown.c
+++ src/markdown.c
@@ -370,10 +370,14 @@
370
371 /* begins with a '<' optionally followed by '/', followed by letter */
372 if( data[0]!='<' ) return 0;
373 i = (data[1]=='/') ? 2 : 1;
374 if( (data[i]<'a' || data[i]>'z') && (data[i]<'A' || data[i]>'Z') ){
375 if( data[1]=='!' && size>=7 && data[2]=='-' && data[3]=='-' ){
376 for(i=6; i<size && (data[i]!='>'||data[i-1]!='-'|| data[i-2]!='-');i++){}
377 if( i<size ) return i;
378 }
379 return 0;
380 }
381
382 /* scheme test */
383 *autolink = MKDA_NOT_AUTOLINK;
384

Keyboard Shortcuts

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