Fossil SCM
Correct spelling of the word "literal."
Commit
73720a34cbf1adebf090356aaf70e730d9dcacb3
Parent
80e7250a4eb05c6…
1 file changed
+56
-56
+56
-56
| --- src/markdown_html.c | ||
| +++ src/markdown_html.c | ||
| @@ -34,16 +34,16 @@ | ||
| 34 | 34 | |
| 35 | 35 | /* INTER_BLOCK -- skip a line between block level elements */ |
| 36 | 36 | #define INTER_BLOCK(ob) \ |
| 37 | 37 | do { if( blob_size(ob)>0 ) blob_append(ob, "\n", 1); } while (0) |
| 38 | 38 | |
| 39 | -/* BLOB_APPEND_LITTERAL -- append a string litteral to a blob */ | |
| 40 | -#define BLOB_APPEND_LITTERAL(blob, litteral) \ | |
| 41 | - blob_append((blob), "" litteral, (sizeof litteral)-1) | |
| 39 | +/* BLOB_APPEND_LITERAL -- append a string literal to a blob */ | |
| 40 | +#define BLOB_APPEND_LITERAL(blob, literal) \ | |
| 41 | + blob_append((blob), "" literal, (sizeof literal)-1) | |
| 42 | 42 | /* |
| 43 | 43 | * The empty string in the second argument leads to a syntax error |
| 44 | - * when the macro is not used with a string litteral. Unfortunately | |
| 44 | + * when the macro is not used with a string literal. Unfortunately | |
| 45 | 45 | * the error is not overly explicit. |
| 46 | 46 | */ |
| 47 | 47 | |
| 48 | 48 | /* BLOB_APPEND_BLOB -- append blob contents to another */ |
| 49 | 49 | #define BLOB_APPEND_BLOB(dest, src) \ |
| @@ -65,17 +65,17 @@ | ||
| 65 | 65 | i++; |
| 66 | 66 | } |
| 67 | 67 | blob_append(ob, data+beg, i-beg); |
| 68 | 68 | while( i<size ){ |
| 69 | 69 | if( data[i]=='<' ){ |
| 70 | - BLOB_APPEND_LITTERAL(ob, "<"); | |
| 70 | + BLOB_APPEND_LITERAL(ob, "<"); | |
| 71 | 71 | }else if( data[i]=='>' ){ |
| 72 | - BLOB_APPEND_LITTERAL(ob, ">"); | |
| 72 | + BLOB_APPEND_LITERAL(ob, ">"); | |
| 73 | 73 | }else if( data[i]=='&' ){ |
| 74 | - BLOB_APPEND_LITTERAL(ob, "&"); | |
| 74 | + BLOB_APPEND_LITERAL(ob, "&"); | |
| 75 | 75 | }else if( data[i]=='"' ){ |
| 76 | - BLOB_APPEND_LITTERAL(ob, """); | |
| 76 | + BLOB_APPEND_LITERAL(ob, """); | |
| 77 | 77 | }else{ |
| 78 | 78 | break; |
| 79 | 79 | } |
| 80 | 80 | i++; |
| 81 | 81 | } |
| @@ -88,41 +88,41 @@ | ||
| 88 | 88 | /* Size of the prolog: "<div class='markdown'>\n" */ |
| 89 | 89 | #define PROLOG_SIZE 23 |
| 90 | 90 | |
| 91 | 91 | static void html_prolog(struct Blob *ob, void *opaque){ |
| 92 | 92 | INTER_BLOCK(ob); |
| 93 | - BLOB_APPEND_LITTERAL(ob, "<div class=\"markdown\">\n"); | |
| 93 | + BLOB_APPEND_LITERAL(ob, "<div class=\"markdown\">\n"); | |
| 94 | 94 | assert( blob_size(ob)==PROLOG_SIZE ); |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | static void html_epilog(struct Blob *ob, void *opaque){ |
| 98 | 98 | INTER_BLOCK(ob); |
| 99 | - BLOB_APPEND_LITTERAL(ob, "</div>\n"); | |
| 99 | + BLOB_APPEND_LITERAL(ob, "</div>\n"); | |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | static void html_raw_block(struct Blob *ob, struct Blob *text, void *opaque){ |
| 103 | 103 | char *data = blob_buffer(text); |
| 104 | 104 | size_t first = 0, size = blob_size(text); |
| 105 | 105 | INTER_BLOCK(ob); |
| 106 | 106 | while( first<size && data[first]=='\n' ) first++; |
| 107 | 107 | while( size>first && data[size-1]=='\n' ) size--; |
| 108 | 108 | blob_append(ob, data+first, size-first); |
| 109 | - BLOB_APPEND_LITTERAL(ob, "\n"); | |
| 109 | + BLOB_APPEND_LITERAL(ob, "\n"); | |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | static void html_blockcode(struct Blob *ob, struct Blob *text, void *opaque){ |
| 113 | 113 | INTER_BLOCK(ob); |
| 114 | - BLOB_APPEND_LITTERAL(ob, "<pre><code>"); | |
| 114 | + BLOB_APPEND_LITERAL(ob, "<pre><code>"); | |
| 115 | 115 | html_escape(ob, blob_buffer(text), blob_size(text)); |
| 116 | - BLOB_APPEND_LITTERAL(ob, "</code></pre>\n"); | |
| 116 | + BLOB_APPEND_LITERAL(ob, "</code></pre>\n"); | |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | static void html_blockquote(struct Blob *ob, struct Blob *text, void *opaque){ |
| 120 | 120 | INTER_BLOCK(ob); |
| 121 | - BLOB_APPEND_LITTERAL(ob, "<blockquote>\n"); | |
| 121 | + BLOB_APPEND_LITERAL(ob, "<blockquote>\n"); | |
| 122 | 122 | BLOB_APPEND_BLOB(ob, text); |
| 123 | - BLOB_APPEND_LITTERAL(ob, "</blockquote>\n"); | |
| 123 | + BLOB_APPEND_LITERAL(ob, "</blockquote>\n"); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | static void html_header( |
| 127 | 127 | struct Blob *ob, |
| 128 | 128 | struct Blob *text, |
| @@ -141,11 +141,11 @@ | ||
| 141 | 141 | blob_appendf(ob, "</h%d>", level); |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | static void html_hrule(struct Blob *ob, void *opaque){ |
| 145 | 145 | INTER_BLOCK(ob); |
| 146 | - BLOB_APPEND_LITTERAL(ob, "<hr />\n"); | |
| 146 | + BLOB_APPEND_LITERAL(ob, "<hr />\n"); | |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | |
| 150 | 150 | static void html_list( |
| 151 | 151 | struct Blob *ob, |
| @@ -169,20 +169,20 @@ | ||
| 169 | 169 | void *opaque |
| 170 | 170 | ){ |
| 171 | 171 | char *text_data = blob_buffer(text); |
| 172 | 172 | size_t text_size = blob_size(text); |
| 173 | 173 | while( text_size>0 && text_data[text_size-1]=='\n' ) text_size--; |
| 174 | - BLOB_APPEND_LITTERAL(ob, "<li>"); | |
| 174 | + BLOB_APPEND_LITERAL(ob, "<li>"); | |
| 175 | 175 | blob_append(ob, text_data, text_size); |
| 176 | - BLOB_APPEND_LITTERAL(ob, "</li>\n"); | |
| 176 | + BLOB_APPEND_LITERAL(ob, "</li>\n"); | |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | static void html_paragraph(struct Blob *ob, struct Blob *text, void *opaque){ |
| 180 | 180 | INTER_BLOCK(ob); |
| 181 | - BLOB_APPEND_LITTERAL(ob, "<p>"); | |
| 181 | + BLOB_APPEND_LITERAL(ob, "<p>"); | |
| 182 | 182 | BLOB_APPEND_BLOB(ob, text); |
| 183 | - BLOB_APPEND_LITTERAL(ob, "</p>\n"); | |
| 183 | + BLOB_APPEND_LITERAL(ob, "</p>\n"); | |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | |
| 187 | 187 | static void html_table( |
| 188 | 188 | struct Blob *ob, |
| @@ -189,68 +189,68 @@ | ||
| 189 | 189 | struct Blob *head_row, |
| 190 | 190 | struct Blob *rows, |
| 191 | 191 | void *opaque |
| 192 | 192 | ){ |
| 193 | 193 | INTER_BLOCK(ob); |
| 194 | - BLOB_APPEND_LITTERAL(ob, "<table>\n"); | |
| 194 | + BLOB_APPEND_LITERAL(ob, "<table>\n"); | |
| 195 | 195 | if( head_row && blob_size(head_row)>0 ){ |
| 196 | - BLOB_APPEND_LITTERAL(ob, "<thead>\n"); | |
| 196 | + BLOB_APPEND_LITERAL(ob, "<thead>\n"); | |
| 197 | 197 | BLOB_APPEND_BLOB(ob, head_row); |
| 198 | - BLOB_APPEND_LITTERAL(ob, "</thead>\n<tbody>\n"); | |
| 198 | + BLOB_APPEND_LITERAL(ob, "</thead>\n<tbody>\n"); | |
| 199 | 199 | } |
| 200 | 200 | if( rows ){ |
| 201 | 201 | BLOB_APPEND_BLOB(ob, rows); |
| 202 | 202 | } |
| 203 | 203 | if( head_row && blob_size(head_row)>0 ){ |
| 204 | - BLOB_APPEND_LITTERAL(ob, "</tbody>\n"); | |
| 204 | + BLOB_APPEND_LITERAL(ob, "</tbody>\n"); | |
| 205 | 205 | } |
| 206 | - BLOB_APPEND_LITTERAL(ob, "</table>\n"); | |
| 206 | + BLOB_APPEND_LITERAL(ob, "</table>\n"); | |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | static void html_table_cell( |
| 210 | 210 | struct Blob *ob, |
| 211 | 211 | struct Blob *text, |
| 212 | 212 | int flags, |
| 213 | 213 | void *opaque |
| 214 | 214 | ){ |
| 215 | 215 | if( flags & MKD_CELL_HEAD ){ |
| 216 | - BLOB_APPEND_LITTERAL(ob, " <th"); | |
| 216 | + BLOB_APPEND_LITERAL(ob, " <th"); | |
| 217 | 217 | }else{ |
| 218 | - BLOB_APPEND_LITTERAL(ob, " <td"); | |
| 218 | + BLOB_APPEND_LITERAL(ob, " <td"); | |
| 219 | 219 | } |
| 220 | 220 | switch( flags & MKD_CELL_ALIGN_MASK ){ |
| 221 | 221 | case MKD_CELL_ALIGN_LEFT: { |
| 222 | - BLOB_APPEND_LITTERAL(ob, " align=\"left\""); | |
| 222 | + BLOB_APPEND_LITERAL(ob, " align=\"left\""); | |
| 223 | 223 | break; |
| 224 | 224 | } |
| 225 | 225 | case MKD_CELL_ALIGN_RIGHT: { |
| 226 | - BLOB_APPEND_LITTERAL(ob, " align=\"right\""); | |
| 226 | + BLOB_APPEND_LITERAL(ob, " align=\"right\""); | |
| 227 | 227 | break; |
| 228 | 228 | } |
| 229 | 229 | case MKD_CELL_ALIGN_CENTER: { |
| 230 | - BLOB_APPEND_LITTERAL(ob, " align=\"center\""); | |
| 230 | + BLOB_APPEND_LITERAL(ob, " align=\"center\""); | |
| 231 | 231 | break; |
| 232 | 232 | } |
| 233 | 233 | } |
| 234 | - BLOB_APPEND_LITTERAL(ob, ">"); | |
| 234 | + BLOB_APPEND_LITERAL(ob, ">"); | |
| 235 | 235 | BLOB_APPEND_BLOB(ob, text); |
| 236 | 236 | if( flags & MKD_CELL_HEAD ){ |
| 237 | - BLOB_APPEND_LITTERAL(ob, "</th>\n"); | |
| 237 | + BLOB_APPEND_LITERAL(ob, "</th>\n"); | |
| 238 | 238 | }else{ |
| 239 | - BLOB_APPEND_LITTERAL(ob, "</td>\n"); | |
| 239 | + BLOB_APPEND_LITERAL(ob, "</td>\n"); | |
| 240 | 240 | } |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | static void html_table_row( |
| 244 | 244 | struct Blob *ob, |
| 245 | 245 | struct Blob *cells, |
| 246 | 246 | int flags, |
| 247 | 247 | void *opaque |
| 248 | 248 | ){ |
| 249 | - BLOB_APPEND_LITTERAL(ob, " <tr>\n"); | |
| 249 | + BLOB_APPEND_LITERAL(ob, " <tr>\n"); | |
| 250 | 250 | BLOB_APPEND_BLOB(ob, cells); |
| 251 | - BLOB_APPEND_LITTERAL(ob, " </tr>\n"); | |
| 251 | + BLOB_APPEND_LITERAL(ob, " </tr>\n"); | |
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | |
| 255 | 255 | |
| 256 | 256 | /* HTML span tags */ |
| @@ -265,52 +265,52 @@ | ||
| 265 | 265 | struct Blob *link, |
| 266 | 266 | enum mkd_autolink type, |
| 267 | 267 | void *opaque |
| 268 | 268 | ){ |
| 269 | 269 | if( !link || blob_size(link)<=0 ) return 0; |
| 270 | - BLOB_APPEND_LITTERAL(ob, "<a href=\""); | |
| 271 | - if( type==MKDA_IMPLICIT_EMAIL ) BLOB_APPEND_LITTERAL(ob, "mailto:"); | |
| 270 | + BLOB_APPEND_LITERAL(ob, "<a href=\""); | |
| 271 | + if( type==MKDA_IMPLICIT_EMAIL ) BLOB_APPEND_LITERAL(ob, "mailto:"); | |
| 272 | 272 | html_escape(ob, blob_buffer(link), blob_size(link)); |
| 273 | - BLOB_APPEND_LITTERAL(ob, "\">"); | |
| 273 | + BLOB_APPEND_LITERAL(ob, "\">"); | |
| 274 | 274 | if( type==MKDA_EXPLICIT_EMAIL && blob_size(link)>7 ){ |
| 275 | 275 | /* remove "mailto:" from displayed text */ |
| 276 | 276 | html_escape(ob, blob_buffer(link)+7, blob_size(link)-7); |
| 277 | 277 | }else{ |
| 278 | 278 | html_escape(ob, blob_buffer(link), blob_size(link)); |
| 279 | 279 | } |
| 280 | - BLOB_APPEND_LITTERAL(ob, "</a>"); | |
| 280 | + BLOB_APPEND_LITERAL(ob, "</a>"); | |
| 281 | 281 | return 1; |
| 282 | 282 | } |
| 283 | 283 | |
| 284 | 284 | static int html_code_span(struct Blob *ob, struct Blob *text, void *opaque){ |
| 285 | - BLOB_APPEND_LITTERAL(ob, "<code>"); | |
| 285 | + BLOB_APPEND_LITERAL(ob, "<code>"); | |
| 286 | 286 | html_escape(ob, blob_buffer(text), blob_size(text)); |
| 287 | - BLOB_APPEND_LITTERAL(ob, "</code>"); | |
| 287 | + BLOB_APPEND_LITERAL(ob, "</code>"); | |
| 288 | 288 | return 1; |
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | static int html_double_emphasis( |
| 292 | 292 | struct Blob *ob, |
| 293 | 293 | struct Blob *text, |
| 294 | 294 | char c, |
| 295 | 295 | void *opaque |
| 296 | 296 | ){ |
| 297 | - BLOB_APPEND_LITTERAL(ob, "<strong>"); | |
| 297 | + BLOB_APPEND_LITERAL(ob, "<strong>"); | |
| 298 | 298 | BLOB_APPEND_BLOB(ob, text); |
| 299 | - BLOB_APPEND_LITTERAL(ob, "</strong>"); | |
| 299 | + BLOB_APPEND_LITERAL(ob, "</strong>"); | |
| 300 | 300 | return 1; |
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | static int html_emphasis( |
| 304 | 304 | struct Blob *ob, |
| 305 | 305 | struct Blob *text, |
| 306 | 306 | char c, |
| 307 | 307 | void *opaque |
| 308 | 308 | ){ |
| 309 | - BLOB_APPEND_LITTERAL(ob, "<em>"); | |
| 309 | + BLOB_APPEND_LITERAL(ob, "<em>"); | |
| 310 | 310 | BLOB_APPEND_BLOB(ob, text); |
| 311 | - BLOB_APPEND_LITTERAL(ob, "</em>"); | |
| 311 | + BLOB_APPEND_LITERAL(ob, "</em>"); | |
| 312 | 312 | return 1; |
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | static int html_image( |
| 316 | 316 | struct Blob *ob, |
| @@ -317,24 +317,24 @@ | ||
| 317 | 317 | struct Blob *link, |
| 318 | 318 | struct Blob *title, |
| 319 | 319 | struct Blob *alt, |
| 320 | 320 | void *opaque |
| 321 | 321 | ){ |
| 322 | - BLOB_APPEND_LITTERAL(ob, "<img src=\""); | |
| 322 | + BLOB_APPEND_LITERAL(ob, "<img src=\""); | |
| 323 | 323 | html_escape(ob, blob_buffer(link), blob_size(link)); |
| 324 | - BLOB_APPEND_LITTERAL(ob, "\" alt=\""); | |
| 324 | + BLOB_APPEND_LITERAL(ob, "\" alt=\""); | |
| 325 | 325 | html_escape(ob, blob_buffer(alt), blob_size(alt)); |
| 326 | 326 | if( title && blob_size(title)>0 ){ |
| 327 | - BLOB_APPEND_LITTERAL(ob, "\" title=\""); | |
| 327 | + BLOB_APPEND_LITERAL(ob, "\" title=\""); | |
| 328 | 328 | html_escape(ob, blob_buffer(title), blob_size(title)); |
| 329 | 329 | } |
| 330 | - BLOB_APPEND_LITTERAL(ob, "\" />"); | |
| 330 | + BLOB_APPEND_LITERAL(ob, "\" />"); | |
| 331 | 331 | return 1; |
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | static int html_line_break(struct Blob *ob, void *opaque){ |
| 335 | - BLOB_APPEND_LITTERAL(ob, "<br />\n"); | |
| 335 | + BLOB_APPEND_LITERAL(ob, "<br />\n"); | |
| 336 | 336 | return 1; |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | static int html_link( |
| 340 | 340 | struct Blob *ob, |
| @@ -341,31 +341,31 @@ | ||
| 341 | 341 | struct Blob *link, |
| 342 | 342 | struct Blob *title, |
| 343 | 343 | struct Blob *content, |
| 344 | 344 | void *opaque |
| 345 | 345 | ){ |
| 346 | - BLOB_APPEND_LITTERAL(ob, "<a href=\""); | |
| 346 | + BLOB_APPEND_LITERAL(ob, "<a href=\""); | |
| 347 | 347 | html_escape(ob, blob_buffer(link), blob_size(link)); |
| 348 | 348 | if( title && blob_size(title)>0 ){ |
| 349 | - BLOB_APPEND_LITTERAL(ob, "\" title=\""); | |
| 349 | + BLOB_APPEND_LITERAL(ob, "\" title=\""); | |
| 350 | 350 | html_escape(ob, blob_buffer(title), blob_size(title)); |
| 351 | 351 | } |
| 352 | - BLOB_APPEND_LITTERAL(ob, "\">"); | |
| 352 | + BLOB_APPEND_LITERAL(ob, "\">"); | |
| 353 | 353 | BLOB_APPEND_BLOB(ob, content); |
| 354 | - BLOB_APPEND_LITTERAL(ob, "</a>"); | |
| 354 | + BLOB_APPEND_LITERAL(ob, "</a>"); | |
| 355 | 355 | return 1; |
| 356 | 356 | } |
| 357 | 357 | |
| 358 | 358 | static int html_triple_emphasis( |
| 359 | 359 | struct Blob *ob, |
| 360 | 360 | struct Blob *text, |
| 361 | 361 | char c, |
| 362 | 362 | void *opaque |
| 363 | 363 | ){ |
| 364 | - BLOB_APPEND_LITTERAL(ob, "<strong><em>"); | |
| 364 | + BLOB_APPEND_LITERAL(ob, "<strong><em>"); | |
| 365 | 365 | BLOB_APPEND_BLOB(ob, text); |
| 366 | - BLOB_APPEND_LITTERAL(ob, "</em></strong>"); | |
| 366 | + BLOB_APPEND_LITERAL(ob, "</em></strong>"); | |
| 367 | 367 | return 1; |
| 368 | 368 | } |
| 369 | 369 | |
| 370 | 370 | |
| 371 | 371 | static void html_normal_text(struct Blob *ob, struct Blob *text, void *opaque){ |
| 372 | 372 |
| --- src/markdown_html.c | |
| +++ src/markdown_html.c | |
| @@ -34,16 +34,16 @@ | |
| 34 | |
| 35 | /* INTER_BLOCK -- skip a line between block level elements */ |
| 36 | #define INTER_BLOCK(ob) \ |
| 37 | do { if( blob_size(ob)>0 ) blob_append(ob, "\n", 1); } while (0) |
| 38 | |
| 39 | /* BLOB_APPEND_LITTERAL -- append a string litteral to a blob */ |
| 40 | #define BLOB_APPEND_LITTERAL(blob, litteral) \ |
| 41 | blob_append((blob), "" litteral, (sizeof litteral)-1) |
| 42 | /* |
| 43 | * The empty string in the second argument leads to a syntax error |
| 44 | * when the macro is not used with a string litteral. Unfortunately |
| 45 | * the error is not overly explicit. |
| 46 | */ |
| 47 | |
| 48 | /* BLOB_APPEND_BLOB -- append blob contents to another */ |
| 49 | #define BLOB_APPEND_BLOB(dest, src) \ |
| @@ -65,17 +65,17 @@ | |
| 65 | i++; |
| 66 | } |
| 67 | blob_append(ob, data+beg, i-beg); |
| 68 | while( i<size ){ |
| 69 | if( data[i]=='<' ){ |
| 70 | BLOB_APPEND_LITTERAL(ob, "<"); |
| 71 | }else if( data[i]=='>' ){ |
| 72 | BLOB_APPEND_LITTERAL(ob, ">"); |
| 73 | }else if( data[i]=='&' ){ |
| 74 | BLOB_APPEND_LITTERAL(ob, "&"); |
| 75 | }else if( data[i]=='"' ){ |
| 76 | BLOB_APPEND_LITTERAL(ob, """); |
| 77 | }else{ |
| 78 | break; |
| 79 | } |
| 80 | i++; |
| 81 | } |
| @@ -88,41 +88,41 @@ | |
| 88 | /* Size of the prolog: "<div class='markdown'>\n" */ |
| 89 | #define PROLOG_SIZE 23 |
| 90 | |
| 91 | static void html_prolog(struct Blob *ob, void *opaque){ |
| 92 | INTER_BLOCK(ob); |
| 93 | BLOB_APPEND_LITTERAL(ob, "<div class=\"markdown\">\n"); |
| 94 | assert( blob_size(ob)==PROLOG_SIZE ); |
| 95 | } |
| 96 | |
| 97 | static void html_epilog(struct Blob *ob, void *opaque){ |
| 98 | INTER_BLOCK(ob); |
| 99 | BLOB_APPEND_LITTERAL(ob, "</div>\n"); |
| 100 | } |
| 101 | |
| 102 | static void html_raw_block(struct Blob *ob, struct Blob *text, void *opaque){ |
| 103 | char *data = blob_buffer(text); |
| 104 | size_t first = 0, size = blob_size(text); |
| 105 | INTER_BLOCK(ob); |
| 106 | while( first<size && data[first]=='\n' ) first++; |
| 107 | while( size>first && data[size-1]=='\n' ) size--; |
| 108 | blob_append(ob, data+first, size-first); |
| 109 | BLOB_APPEND_LITTERAL(ob, "\n"); |
| 110 | } |
| 111 | |
| 112 | static void html_blockcode(struct Blob *ob, struct Blob *text, void *opaque){ |
| 113 | INTER_BLOCK(ob); |
| 114 | BLOB_APPEND_LITTERAL(ob, "<pre><code>"); |
| 115 | html_escape(ob, blob_buffer(text), blob_size(text)); |
| 116 | BLOB_APPEND_LITTERAL(ob, "</code></pre>\n"); |
| 117 | } |
| 118 | |
| 119 | static void html_blockquote(struct Blob *ob, struct Blob *text, void *opaque){ |
| 120 | INTER_BLOCK(ob); |
| 121 | BLOB_APPEND_LITTERAL(ob, "<blockquote>\n"); |
| 122 | BLOB_APPEND_BLOB(ob, text); |
| 123 | BLOB_APPEND_LITTERAL(ob, "</blockquote>\n"); |
| 124 | } |
| 125 | |
| 126 | static void html_header( |
| 127 | struct Blob *ob, |
| 128 | struct Blob *text, |
| @@ -141,11 +141,11 @@ | |
| 141 | blob_appendf(ob, "</h%d>", level); |
| 142 | } |
| 143 | |
| 144 | static void html_hrule(struct Blob *ob, void *opaque){ |
| 145 | INTER_BLOCK(ob); |
| 146 | BLOB_APPEND_LITTERAL(ob, "<hr />\n"); |
| 147 | } |
| 148 | |
| 149 | |
| 150 | static void html_list( |
| 151 | struct Blob *ob, |
| @@ -169,20 +169,20 @@ | |
| 169 | void *opaque |
| 170 | ){ |
| 171 | char *text_data = blob_buffer(text); |
| 172 | size_t text_size = blob_size(text); |
| 173 | while( text_size>0 && text_data[text_size-1]=='\n' ) text_size--; |
| 174 | BLOB_APPEND_LITTERAL(ob, "<li>"); |
| 175 | blob_append(ob, text_data, text_size); |
| 176 | BLOB_APPEND_LITTERAL(ob, "</li>\n"); |
| 177 | } |
| 178 | |
| 179 | static void html_paragraph(struct Blob *ob, struct Blob *text, void *opaque){ |
| 180 | INTER_BLOCK(ob); |
| 181 | BLOB_APPEND_LITTERAL(ob, "<p>"); |
| 182 | BLOB_APPEND_BLOB(ob, text); |
| 183 | BLOB_APPEND_LITTERAL(ob, "</p>\n"); |
| 184 | } |
| 185 | |
| 186 | |
| 187 | static void html_table( |
| 188 | struct Blob *ob, |
| @@ -189,68 +189,68 @@ | |
| 189 | struct Blob *head_row, |
| 190 | struct Blob *rows, |
| 191 | void *opaque |
| 192 | ){ |
| 193 | INTER_BLOCK(ob); |
| 194 | BLOB_APPEND_LITTERAL(ob, "<table>\n"); |
| 195 | if( head_row && blob_size(head_row)>0 ){ |
| 196 | BLOB_APPEND_LITTERAL(ob, "<thead>\n"); |
| 197 | BLOB_APPEND_BLOB(ob, head_row); |
| 198 | BLOB_APPEND_LITTERAL(ob, "</thead>\n<tbody>\n"); |
| 199 | } |
| 200 | if( rows ){ |
| 201 | BLOB_APPEND_BLOB(ob, rows); |
| 202 | } |
| 203 | if( head_row && blob_size(head_row)>0 ){ |
| 204 | BLOB_APPEND_LITTERAL(ob, "</tbody>\n"); |
| 205 | } |
| 206 | BLOB_APPEND_LITTERAL(ob, "</table>\n"); |
| 207 | } |
| 208 | |
| 209 | static void html_table_cell( |
| 210 | struct Blob *ob, |
| 211 | struct Blob *text, |
| 212 | int flags, |
| 213 | void *opaque |
| 214 | ){ |
| 215 | if( flags & MKD_CELL_HEAD ){ |
| 216 | BLOB_APPEND_LITTERAL(ob, " <th"); |
| 217 | }else{ |
| 218 | BLOB_APPEND_LITTERAL(ob, " <td"); |
| 219 | } |
| 220 | switch( flags & MKD_CELL_ALIGN_MASK ){ |
| 221 | case MKD_CELL_ALIGN_LEFT: { |
| 222 | BLOB_APPEND_LITTERAL(ob, " align=\"left\""); |
| 223 | break; |
| 224 | } |
| 225 | case MKD_CELL_ALIGN_RIGHT: { |
| 226 | BLOB_APPEND_LITTERAL(ob, " align=\"right\""); |
| 227 | break; |
| 228 | } |
| 229 | case MKD_CELL_ALIGN_CENTER: { |
| 230 | BLOB_APPEND_LITTERAL(ob, " align=\"center\""); |
| 231 | break; |
| 232 | } |
| 233 | } |
| 234 | BLOB_APPEND_LITTERAL(ob, ">"); |
| 235 | BLOB_APPEND_BLOB(ob, text); |
| 236 | if( flags & MKD_CELL_HEAD ){ |
| 237 | BLOB_APPEND_LITTERAL(ob, "</th>\n"); |
| 238 | }else{ |
| 239 | BLOB_APPEND_LITTERAL(ob, "</td>\n"); |
| 240 | } |
| 241 | } |
| 242 | |
| 243 | static void html_table_row( |
| 244 | struct Blob *ob, |
| 245 | struct Blob *cells, |
| 246 | int flags, |
| 247 | void *opaque |
| 248 | ){ |
| 249 | BLOB_APPEND_LITTERAL(ob, " <tr>\n"); |
| 250 | BLOB_APPEND_BLOB(ob, cells); |
| 251 | BLOB_APPEND_LITTERAL(ob, " </tr>\n"); |
| 252 | } |
| 253 | |
| 254 | |
| 255 | |
| 256 | /* HTML span tags */ |
| @@ -265,52 +265,52 @@ | |
| 265 | struct Blob *link, |
| 266 | enum mkd_autolink type, |
| 267 | void *opaque |
| 268 | ){ |
| 269 | if( !link || blob_size(link)<=0 ) return 0; |
| 270 | BLOB_APPEND_LITTERAL(ob, "<a href=\""); |
| 271 | if( type==MKDA_IMPLICIT_EMAIL ) BLOB_APPEND_LITTERAL(ob, "mailto:"); |
| 272 | html_escape(ob, blob_buffer(link), blob_size(link)); |
| 273 | BLOB_APPEND_LITTERAL(ob, "\">"); |
| 274 | if( type==MKDA_EXPLICIT_EMAIL && blob_size(link)>7 ){ |
| 275 | /* remove "mailto:" from displayed text */ |
| 276 | html_escape(ob, blob_buffer(link)+7, blob_size(link)-7); |
| 277 | }else{ |
| 278 | html_escape(ob, blob_buffer(link), blob_size(link)); |
| 279 | } |
| 280 | BLOB_APPEND_LITTERAL(ob, "</a>"); |
| 281 | return 1; |
| 282 | } |
| 283 | |
| 284 | static int html_code_span(struct Blob *ob, struct Blob *text, void *opaque){ |
| 285 | BLOB_APPEND_LITTERAL(ob, "<code>"); |
| 286 | html_escape(ob, blob_buffer(text), blob_size(text)); |
| 287 | BLOB_APPEND_LITTERAL(ob, "</code>"); |
| 288 | return 1; |
| 289 | } |
| 290 | |
| 291 | static int html_double_emphasis( |
| 292 | struct Blob *ob, |
| 293 | struct Blob *text, |
| 294 | char c, |
| 295 | void *opaque |
| 296 | ){ |
| 297 | BLOB_APPEND_LITTERAL(ob, "<strong>"); |
| 298 | BLOB_APPEND_BLOB(ob, text); |
| 299 | BLOB_APPEND_LITTERAL(ob, "</strong>"); |
| 300 | return 1; |
| 301 | } |
| 302 | |
| 303 | static int html_emphasis( |
| 304 | struct Blob *ob, |
| 305 | struct Blob *text, |
| 306 | char c, |
| 307 | void *opaque |
| 308 | ){ |
| 309 | BLOB_APPEND_LITTERAL(ob, "<em>"); |
| 310 | BLOB_APPEND_BLOB(ob, text); |
| 311 | BLOB_APPEND_LITTERAL(ob, "</em>"); |
| 312 | return 1; |
| 313 | } |
| 314 | |
| 315 | static int html_image( |
| 316 | struct Blob *ob, |
| @@ -317,24 +317,24 @@ | |
| 317 | struct Blob *link, |
| 318 | struct Blob *title, |
| 319 | struct Blob *alt, |
| 320 | void *opaque |
| 321 | ){ |
| 322 | BLOB_APPEND_LITTERAL(ob, "<img src=\""); |
| 323 | html_escape(ob, blob_buffer(link), blob_size(link)); |
| 324 | BLOB_APPEND_LITTERAL(ob, "\" alt=\""); |
| 325 | html_escape(ob, blob_buffer(alt), blob_size(alt)); |
| 326 | if( title && blob_size(title)>0 ){ |
| 327 | BLOB_APPEND_LITTERAL(ob, "\" title=\""); |
| 328 | html_escape(ob, blob_buffer(title), blob_size(title)); |
| 329 | } |
| 330 | BLOB_APPEND_LITTERAL(ob, "\" />"); |
| 331 | return 1; |
| 332 | } |
| 333 | |
| 334 | static int html_line_break(struct Blob *ob, void *opaque){ |
| 335 | BLOB_APPEND_LITTERAL(ob, "<br />\n"); |
| 336 | return 1; |
| 337 | } |
| 338 | |
| 339 | static int html_link( |
| 340 | struct Blob *ob, |
| @@ -341,31 +341,31 @@ | |
| 341 | struct Blob *link, |
| 342 | struct Blob *title, |
| 343 | struct Blob *content, |
| 344 | void *opaque |
| 345 | ){ |
| 346 | BLOB_APPEND_LITTERAL(ob, "<a href=\""); |
| 347 | html_escape(ob, blob_buffer(link), blob_size(link)); |
| 348 | if( title && blob_size(title)>0 ){ |
| 349 | BLOB_APPEND_LITTERAL(ob, "\" title=\""); |
| 350 | html_escape(ob, blob_buffer(title), blob_size(title)); |
| 351 | } |
| 352 | BLOB_APPEND_LITTERAL(ob, "\">"); |
| 353 | BLOB_APPEND_BLOB(ob, content); |
| 354 | BLOB_APPEND_LITTERAL(ob, "</a>"); |
| 355 | return 1; |
| 356 | } |
| 357 | |
| 358 | static int html_triple_emphasis( |
| 359 | struct Blob *ob, |
| 360 | struct Blob *text, |
| 361 | char c, |
| 362 | void *opaque |
| 363 | ){ |
| 364 | BLOB_APPEND_LITTERAL(ob, "<strong><em>"); |
| 365 | BLOB_APPEND_BLOB(ob, text); |
| 366 | BLOB_APPEND_LITTERAL(ob, "</em></strong>"); |
| 367 | return 1; |
| 368 | } |
| 369 | |
| 370 | |
| 371 | static void html_normal_text(struct Blob *ob, struct Blob *text, void *opaque){ |
| 372 |
| --- src/markdown_html.c | |
| +++ src/markdown_html.c | |
| @@ -34,16 +34,16 @@ | |
| 34 | |
| 35 | /* INTER_BLOCK -- skip a line between block level elements */ |
| 36 | #define INTER_BLOCK(ob) \ |
| 37 | do { if( blob_size(ob)>0 ) blob_append(ob, "\n", 1); } while (0) |
| 38 | |
| 39 | /* BLOB_APPEND_LITERAL -- append a string literal to a blob */ |
| 40 | #define BLOB_APPEND_LITERAL(blob, literal) \ |
| 41 | blob_append((blob), "" literal, (sizeof literal)-1) |
| 42 | /* |
| 43 | * The empty string in the second argument leads to a syntax error |
| 44 | * when the macro is not used with a string literal. Unfortunately |
| 45 | * the error is not overly explicit. |
| 46 | */ |
| 47 | |
| 48 | /* BLOB_APPEND_BLOB -- append blob contents to another */ |
| 49 | #define BLOB_APPEND_BLOB(dest, src) \ |
| @@ -65,17 +65,17 @@ | |
| 65 | i++; |
| 66 | } |
| 67 | blob_append(ob, data+beg, i-beg); |
| 68 | while( i<size ){ |
| 69 | if( data[i]=='<' ){ |
| 70 | BLOB_APPEND_LITERAL(ob, "<"); |
| 71 | }else if( data[i]=='>' ){ |
| 72 | BLOB_APPEND_LITERAL(ob, ">"); |
| 73 | }else if( data[i]=='&' ){ |
| 74 | BLOB_APPEND_LITERAL(ob, "&"); |
| 75 | }else if( data[i]=='"' ){ |
| 76 | BLOB_APPEND_LITERAL(ob, """); |
| 77 | }else{ |
| 78 | break; |
| 79 | } |
| 80 | i++; |
| 81 | } |
| @@ -88,41 +88,41 @@ | |
| 88 | /* Size of the prolog: "<div class='markdown'>\n" */ |
| 89 | #define PROLOG_SIZE 23 |
| 90 | |
| 91 | static void html_prolog(struct Blob *ob, void *opaque){ |
| 92 | INTER_BLOCK(ob); |
| 93 | BLOB_APPEND_LITERAL(ob, "<div class=\"markdown\">\n"); |
| 94 | assert( blob_size(ob)==PROLOG_SIZE ); |
| 95 | } |
| 96 | |
| 97 | static void html_epilog(struct Blob *ob, void *opaque){ |
| 98 | INTER_BLOCK(ob); |
| 99 | BLOB_APPEND_LITERAL(ob, "</div>\n"); |
| 100 | } |
| 101 | |
| 102 | static void html_raw_block(struct Blob *ob, struct Blob *text, void *opaque){ |
| 103 | char *data = blob_buffer(text); |
| 104 | size_t first = 0, size = blob_size(text); |
| 105 | INTER_BLOCK(ob); |
| 106 | while( first<size && data[first]=='\n' ) first++; |
| 107 | while( size>first && data[size-1]=='\n' ) size--; |
| 108 | blob_append(ob, data+first, size-first); |
| 109 | BLOB_APPEND_LITERAL(ob, "\n"); |
| 110 | } |
| 111 | |
| 112 | static void html_blockcode(struct Blob *ob, struct Blob *text, void *opaque){ |
| 113 | INTER_BLOCK(ob); |
| 114 | BLOB_APPEND_LITERAL(ob, "<pre><code>"); |
| 115 | html_escape(ob, blob_buffer(text), blob_size(text)); |
| 116 | BLOB_APPEND_LITERAL(ob, "</code></pre>\n"); |
| 117 | } |
| 118 | |
| 119 | static void html_blockquote(struct Blob *ob, struct Blob *text, void *opaque){ |
| 120 | INTER_BLOCK(ob); |
| 121 | BLOB_APPEND_LITERAL(ob, "<blockquote>\n"); |
| 122 | BLOB_APPEND_BLOB(ob, text); |
| 123 | BLOB_APPEND_LITERAL(ob, "</blockquote>\n"); |
| 124 | } |
| 125 | |
| 126 | static void html_header( |
| 127 | struct Blob *ob, |
| 128 | struct Blob *text, |
| @@ -141,11 +141,11 @@ | |
| 141 | blob_appendf(ob, "</h%d>", level); |
| 142 | } |
| 143 | |
| 144 | static void html_hrule(struct Blob *ob, void *opaque){ |
| 145 | INTER_BLOCK(ob); |
| 146 | BLOB_APPEND_LITERAL(ob, "<hr />\n"); |
| 147 | } |
| 148 | |
| 149 | |
| 150 | static void html_list( |
| 151 | struct Blob *ob, |
| @@ -169,20 +169,20 @@ | |
| 169 | void *opaque |
| 170 | ){ |
| 171 | char *text_data = blob_buffer(text); |
| 172 | size_t text_size = blob_size(text); |
| 173 | while( text_size>0 && text_data[text_size-1]=='\n' ) text_size--; |
| 174 | BLOB_APPEND_LITERAL(ob, "<li>"); |
| 175 | blob_append(ob, text_data, text_size); |
| 176 | BLOB_APPEND_LITERAL(ob, "</li>\n"); |
| 177 | } |
| 178 | |
| 179 | static void html_paragraph(struct Blob *ob, struct Blob *text, void *opaque){ |
| 180 | INTER_BLOCK(ob); |
| 181 | BLOB_APPEND_LITERAL(ob, "<p>"); |
| 182 | BLOB_APPEND_BLOB(ob, text); |
| 183 | BLOB_APPEND_LITERAL(ob, "</p>\n"); |
| 184 | } |
| 185 | |
| 186 | |
| 187 | static void html_table( |
| 188 | struct Blob *ob, |
| @@ -189,68 +189,68 @@ | |
| 189 | struct Blob *head_row, |
| 190 | struct Blob *rows, |
| 191 | void *opaque |
| 192 | ){ |
| 193 | INTER_BLOCK(ob); |
| 194 | BLOB_APPEND_LITERAL(ob, "<table>\n"); |
| 195 | if( head_row && blob_size(head_row)>0 ){ |
| 196 | BLOB_APPEND_LITERAL(ob, "<thead>\n"); |
| 197 | BLOB_APPEND_BLOB(ob, head_row); |
| 198 | BLOB_APPEND_LITERAL(ob, "</thead>\n<tbody>\n"); |
| 199 | } |
| 200 | if( rows ){ |
| 201 | BLOB_APPEND_BLOB(ob, rows); |
| 202 | } |
| 203 | if( head_row && blob_size(head_row)>0 ){ |
| 204 | BLOB_APPEND_LITERAL(ob, "</tbody>\n"); |
| 205 | } |
| 206 | BLOB_APPEND_LITERAL(ob, "</table>\n"); |
| 207 | } |
| 208 | |
| 209 | static void html_table_cell( |
| 210 | struct Blob *ob, |
| 211 | struct Blob *text, |
| 212 | int flags, |
| 213 | void *opaque |
| 214 | ){ |
| 215 | if( flags & MKD_CELL_HEAD ){ |
| 216 | BLOB_APPEND_LITERAL(ob, " <th"); |
| 217 | }else{ |
| 218 | BLOB_APPEND_LITERAL(ob, " <td"); |
| 219 | } |
| 220 | switch( flags & MKD_CELL_ALIGN_MASK ){ |
| 221 | case MKD_CELL_ALIGN_LEFT: { |
| 222 | BLOB_APPEND_LITERAL(ob, " align=\"left\""); |
| 223 | break; |
| 224 | } |
| 225 | case MKD_CELL_ALIGN_RIGHT: { |
| 226 | BLOB_APPEND_LITERAL(ob, " align=\"right\""); |
| 227 | break; |
| 228 | } |
| 229 | case MKD_CELL_ALIGN_CENTER: { |
| 230 | BLOB_APPEND_LITERAL(ob, " align=\"center\""); |
| 231 | break; |
| 232 | } |
| 233 | } |
| 234 | BLOB_APPEND_LITERAL(ob, ">"); |
| 235 | BLOB_APPEND_BLOB(ob, text); |
| 236 | if( flags & MKD_CELL_HEAD ){ |
| 237 | BLOB_APPEND_LITERAL(ob, "</th>\n"); |
| 238 | }else{ |
| 239 | BLOB_APPEND_LITERAL(ob, "</td>\n"); |
| 240 | } |
| 241 | } |
| 242 | |
| 243 | static void html_table_row( |
| 244 | struct Blob *ob, |
| 245 | struct Blob *cells, |
| 246 | int flags, |
| 247 | void *opaque |
| 248 | ){ |
| 249 | BLOB_APPEND_LITERAL(ob, " <tr>\n"); |
| 250 | BLOB_APPEND_BLOB(ob, cells); |
| 251 | BLOB_APPEND_LITERAL(ob, " </tr>\n"); |
| 252 | } |
| 253 | |
| 254 | |
| 255 | |
| 256 | /* HTML span tags */ |
| @@ -265,52 +265,52 @@ | |
| 265 | struct Blob *link, |
| 266 | enum mkd_autolink type, |
| 267 | void *opaque |
| 268 | ){ |
| 269 | if( !link || blob_size(link)<=0 ) return 0; |
| 270 | BLOB_APPEND_LITERAL(ob, "<a href=\""); |
| 271 | if( type==MKDA_IMPLICIT_EMAIL ) BLOB_APPEND_LITERAL(ob, "mailto:"); |
| 272 | html_escape(ob, blob_buffer(link), blob_size(link)); |
| 273 | BLOB_APPEND_LITERAL(ob, "\">"); |
| 274 | if( type==MKDA_EXPLICIT_EMAIL && blob_size(link)>7 ){ |
| 275 | /* remove "mailto:" from displayed text */ |
| 276 | html_escape(ob, blob_buffer(link)+7, blob_size(link)-7); |
| 277 | }else{ |
| 278 | html_escape(ob, blob_buffer(link), blob_size(link)); |
| 279 | } |
| 280 | BLOB_APPEND_LITERAL(ob, "</a>"); |
| 281 | return 1; |
| 282 | } |
| 283 | |
| 284 | static int html_code_span(struct Blob *ob, struct Blob *text, void *opaque){ |
| 285 | BLOB_APPEND_LITERAL(ob, "<code>"); |
| 286 | html_escape(ob, blob_buffer(text), blob_size(text)); |
| 287 | BLOB_APPEND_LITERAL(ob, "</code>"); |
| 288 | return 1; |
| 289 | } |
| 290 | |
| 291 | static int html_double_emphasis( |
| 292 | struct Blob *ob, |
| 293 | struct Blob *text, |
| 294 | char c, |
| 295 | void *opaque |
| 296 | ){ |
| 297 | BLOB_APPEND_LITERAL(ob, "<strong>"); |
| 298 | BLOB_APPEND_BLOB(ob, text); |
| 299 | BLOB_APPEND_LITERAL(ob, "</strong>"); |
| 300 | return 1; |
| 301 | } |
| 302 | |
| 303 | static int html_emphasis( |
| 304 | struct Blob *ob, |
| 305 | struct Blob *text, |
| 306 | char c, |
| 307 | void *opaque |
| 308 | ){ |
| 309 | BLOB_APPEND_LITERAL(ob, "<em>"); |
| 310 | BLOB_APPEND_BLOB(ob, text); |
| 311 | BLOB_APPEND_LITERAL(ob, "</em>"); |
| 312 | return 1; |
| 313 | } |
| 314 | |
| 315 | static int html_image( |
| 316 | struct Blob *ob, |
| @@ -317,24 +317,24 @@ | |
| 317 | struct Blob *link, |
| 318 | struct Blob *title, |
| 319 | struct Blob *alt, |
| 320 | void *opaque |
| 321 | ){ |
| 322 | BLOB_APPEND_LITERAL(ob, "<img src=\""); |
| 323 | html_escape(ob, blob_buffer(link), blob_size(link)); |
| 324 | BLOB_APPEND_LITERAL(ob, "\" alt=\""); |
| 325 | html_escape(ob, blob_buffer(alt), blob_size(alt)); |
| 326 | if( title && blob_size(title)>0 ){ |
| 327 | BLOB_APPEND_LITERAL(ob, "\" title=\""); |
| 328 | html_escape(ob, blob_buffer(title), blob_size(title)); |
| 329 | } |
| 330 | BLOB_APPEND_LITERAL(ob, "\" />"); |
| 331 | return 1; |
| 332 | } |
| 333 | |
| 334 | static int html_line_break(struct Blob *ob, void *opaque){ |
| 335 | BLOB_APPEND_LITERAL(ob, "<br />\n"); |
| 336 | return 1; |
| 337 | } |
| 338 | |
| 339 | static int html_link( |
| 340 | struct Blob *ob, |
| @@ -341,31 +341,31 @@ | |
| 341 | struct Blob *link, |
| 342 | struct Blob *title, |
| 343 | struct Blob *content, |
| 344 | void *opaque |
| 345 | ){ |
| 346 | BLOB_APPEND_LITERAL(ob, "<a href=\""); |
| 347 | html_escape(ob, blob_buffer(link), blob_size(link)); |
| 348 | if( title && blob_size(title)>0 ){ |
| 349 | BLOB_APPEND_LITERAL(ob, "\" title=\""); |
| 350 | html_escape(ob, blob_buffer(title), blob_size(title)); |
| 351 | } |
| 352 | BLOB_APPEND_LITERAL(ob, "\">"); |
| 353 | BLOB_APPEND_BLOB(ob, content); |
| 354 | BLOB_APPEND_LITERAL(ob, "</a>"); |
| 355 | return 1; |
| 356 | } |
| 357 | |
| 358 | static int html_triple_emphasis( |
| 359 | struct Blob *ob, |
| 360 | struct Blob *text, |
| 361 | char c, |
| 362 | void *opaque |
| 363 | ){ |
| 364 | BLOB_APPEND_LITERAL(ob, "<strong><em>"); |
| 365 | BLOB_APPEND_BLOB(ob, text); |
| 366 | BLOB_APPEND_LITERAL(ob, "</em></strong>"); |
| 367 | return 1; |
| 368 | } |
| 369 | |
| 370 | |
| 371 | static void html_normal_text(struct Blob *ob, struct Blob *text, void *opaque){ |
| 372 |