Fossil SCM
Fix parsing of a multiline definition of labeled footnote for the case when lines end with CR+LF.
Commit
ea66d15cf39d36109f6d20dc36bbbff9a2cb65e6c7768bd1a326c918ef60c5b1
Parent
2b1375abadb4f86…
1 file changed
+3
-3
+3
-3
| --- src/markdown.c | ||
| +++ src/markdown.c | ||
| @@ -2433,18 +2433,18 @@ | ||
| 2433 | 2433 | do i++; while( i<end && data[i]!='\n' && data[i]!='\r' ); |
| 2434 | 2434 | blob_append(&fn.text, data+j, i-j); |
| 2435 | 2435 | if( i<end ){ |
| 2436 | 2436 | blob_append_char(&fn.text, data[i]); |
| 2437 | 2437 | i++; |
| 2438 | - if( i<end && data[i]=='\r' && data[i-1] == '\n' ){ | |
| 2438 | + if( i<end && data[i]=='\n' && data[i-1]=='\r' ){ | |
| 2439 | 2439 | blob_append_char(&fn.text, data[i]); |
| 2440 | 2440 | i++; |
| 2441 | 2441 | } |
| 2442 | 2442 | } |
| 2443 | 2443 | }else{ |
| 2444 | 2444 | 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++; | |
| 2446 | 2446 | } |
| 2447 | 2447 | if( i<end ){ |
| 2448 | 2448 | |
| 2449 | 2449 | /* compute the indentation from the 2nd line */ |
| 2450 | 2450 | size_t indent = i; |
| @@ -2463,11 +2463,11 @@ | ||
| 2463 | 2463 | while( i<end && data[i]!='\n' && data[i]!='\r' ) i++; |
| 2464 | 2464 | blob_append(&fn.text, data+j, i-j); |
| 2465 | 2465 | if( i>=end ) break; |
| 2466 | 2466 | blob_append_char(&fn.text, data[i]); |
| 2467 | 2467 | i++; |
| 2468 | - if( i<end && data[i]=='\r' && data[i-1] == '\n' ){ | |
| 2468 | + if( i<end && data[i]=='\n' && data[i-1]=='\r' ){ | |
| 2469 | 2469 | blob_append_char(&fn.text, data[i]); |
| 2470 | 2470 | i++; |
| 2471 | 2471 | } |
| 2472 | 2472 | } |
| 2473 | 2473 | } |
| 2474 | 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]=='\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 |