Fossil SCM

Fix parsing of a multiline definition of labeled footnote for the case when lines end with CR+LF.

george 2022-02-11 01:26 markdown-footnotes
Commit ea66d15cf39d36109f6d20dc36bbbff9a2cb65e6c7768bd1a326c918ef60c5b1
1 file changed +3 -3
+3 -3
--- src/markdown.c
+++ src/markdown.c
@@ -2433,18 +2433,18 @@
24332433
do i++; while( i<end && data[i]!='\n' && data[i]!='\r' );
24342434
blob_append(&fn.text, data+j, i-j);
24352435
if( i<end ){
24362436
blob_append_char(&fn.text, data[i]);
24372437
i++;
2438
- if( i<end && data[i]=='\r' && data[i-1] == '\n' ){
2438
+ if( i<end && data[i]=='\n' && data[i-1]=='\r' ){
24392439
blob_append_char(&fn.text, data[i]);
24402440
i++;
24412441
}
24422442
}
24432443
}else{
24442444
i++;
2445
- if( i<end && data[i]=='\r' && data[i-1] == '\n' ) i++;
2445
+ if( i<end && data[i]=='\n' && data[i-1]=='\r' ) i++;
24462446
}
24472447
if( i<end ){
24482448
24492449
/* compute the indentation from the 2nd line */
24502450
size_t indent = i;
@@ -2463,11 +2463,11 @@
24632463
while( i<end && data[i]!='\n' && data[i]!='\r' ) i++;
24642464
blob_append(&fn.text, data+j, i-j);
24652465
if( i>=end ) break;
24662466
blob_append_char(&fn.text, data[i]);
24672467
i++;
2468
- if( i<end && data[i]=='\r' && data[i-1] == '\n' ){
2468
+ if( i<end && data[i]=='\n' && data[i-1]=='\r' ){
24692469
blob_append_char(&fn.text, data[i]);
24702470
i++;
24712471
}
24722472
}
24732473
}
24742474
--- src/markdown.c
+++ src/markdown.c
@@ -2433,18 +2433,18 @@
2433 do i++; while( i<end && data[i]!='\n' && data[i]!='\r' );
2434 blob_append(&fn.text, data+j, i-j);
2435 if( i<end ){
2436 blob_append_char(&fn.text, data[i]);
2437 i++;
2438 if( i<end && data[i]=='\r' && data[i-1] == '\n' ){
2439 blob_append_char(&fn.text, data[i]);
2440 i++;
2441 }
2442 }
2443 }else{
2444 i++;
2445 if( i<end && data[i]=='\r' && data[i-1] == '\n' ) i++;
2446 }
2447 if( i<end ){
2448
2449 /* compute the indentation from the 2nd line */
2450 size_t indent = i;
@@ -2463,11 +2463,11 @@
2463 while( i<end && data[i]!='\n' && data[i]!='\r' ) i++;
2464 blob_append(&fn.text, data+j, i-j);
2465 if( i>=end ) break;
2466 blob_append_char(&fn.text, data[i]);
2467 i++;
2468 if( i<end && data[i]=='\r' && data[i-1] == '\n' ){
2469 blob_append_char(&fn.text, data[i]);
2470 i++;
2471 }
2472 }
2473 }
2474
--- src/markdown.c
+++ src/markdown.c
@@ -2433,18 +2433,18 @@
2433 do i++; while( i<end && data[i]!='\n' && data[i]!='\r' );
2434 blob_append(&fn.text, data+j, i-j);
2435 if( i<end ){
2436 blob_append_char(&fn.text, data[i]);
2437 i++;
2438 if( i<end && data[i]=='\n' && data[i-1]=='\r' ){
2439 blob_append_char(&fn.text, data[i]);
2440 i++;
2441 }
2442 }
2443 }else{
2444 i++;
2445 if( i<end && data[i]=='\n' && data[i-1]=='\r' ) i++;
2446 }
2447 if( i<end ){
2448
2449 /* compute the indentation from the 2nd line */
2450 size_t indent = i;
@@ -2463,11 +2463,11 @@
2463 while( i<end && data[i]!='\n' && data[i]!='\r' ) i++;
2464 blob_append(&fn.text, data+j, i-j);
2465 if( i>=end ) break;
2466 blob_append_char(&fn.text, data[i]);
2467 i++;
2468 if( i<end && data[i]=='\n' && data[i-1]=='\r' ){
2469 blob_append_char(&fn.text, data[i]);
2470 i++;
2471 }
2472 }
2473 }
2474

Keyboard Shortcuts

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