Fossil SCM
Fix a problem with markdown rendering for "code".
Commit
04de083ec842c3f22f64bb05c9472d7432482dcaf92591415492c1e21ce6d65f
Parent
8ffba76b7342556…
1 file changed
+5
-3
+5
-3
| --- src/markdown_html.c | ||
| +++ src/markdown_html.c | ||
| @@ -296,13 +296,15 @@ | ||
| 296 | 296 | BLOB_APPEND_LITERAL(ob, "</a>"); |
| 297 | 297 | return 1; |
| 298 | 298 | } |
| 299 | 299 | |
| 300 | 300 | static int html_code_span(struct Blob *ob, struct Blob *text, void *opaque){ |
| 301 | - BLOB_APPEND_LITERAL(ob, "<code>"); | |
| 302 | - html_escape(ob, blob_buffer(text), blob_size(text)); | |
| 303 | - BLOB_APPEND_LITERAL(ob, "</code>"); | |
| 301 | + if( text ){ | |
| 302 | + BLOB_APPEND_LITERAL(ob, "<code>"); | |
| 303 | + html_escape(ob, blob_buffer(text), blob_size(text)); | |
| 304 | + BLOB_APPEND_LITERAL(ob, "</code>"); | |
| 305 | + } | |
| 304 | 306 | return 1; |
| 305 | 307 | } |
| 306 | 308 | |
| 307 | 309 | static int html_double_emphasis( |
| 308 | 310 | struct Blob *ob, |
| 309 | 311 |
| --- src/markdown_html.c | |
| +++ src/markdown_html.c | |
| @@ -296,13 +296,15 @@ | |
| 296 | BLOB_APPEND_LITERAL(ob, "</a>"); |
| 297 | return 1; |
| 298 | } |
| 299 | |
| 300 | static int html_code_span(struct Blob *ob, struct Blob *text, void *opaque){ |
| 301 | BLOB_APPEND_LITERAL(ob, "<code>"); |
| 302 | html_escape(ob, blob_buffer(text), blob_size(text)); |
| 303 | BLOB_APPEND_LITERAL(ob, "</code>"); |
| 304 | return 1; |
| 305 | } |
| 306 | |
| 307 | static int html_double_emphasis( |
| 308 | struct Blob *ob, |
| 309 |
| --- src/markdown_html.c | |
| +++ src/markdown_html.c | |
| @@ -296,13 +296,15 @@ | |
| 296 | BLOB_APPEND_LITERAL(ob, "</a>"); |
| 297 | return 1; |
| 298 | } |
| 299 | |
| 300 | static int html_code_span(struct Blob *ob, struct Blob *text, void *opaque){ |
| 301 | if( text ){ |
| 302 | BLOB_APPEND_LITERAL(ob, "<code>"); |
| 303 | html_escape(ob, blob_buffer(text), blob_size(text)); |
| 304 | BLOB_APPEND_LITERAL(ob, "</code>"); |
| 305 | } |
| 306 | return 1; |
| 307 | } |
| 308 | |
| 309 | static int html_double_emphasis( |
| 310 | struct Blob *ob, |
| 311 |