| | @@ -35,12 +35,12 @@ |
| 35 | 35 | #if INTERFACE |
| 36 | 36 | |
| 37 | 37 | /* mkd_autolink -- type of autolink */ |
| 38 | 38 | enum mkd_autolink { |
| 39 | 39 | MKDA_NOT_AUTOLINK, /* used internally when it is not an autolink*/ |
| 40 | | - MKDA_NORMAL, /* normal http/http/ftp/etc link */ |
| 41 | | - MKDA_EXPLICIT_EMAIL, /* e-mail link with explit mailto: */ |
| 40 | + MKDA_NORMAL, /* normal http/http/ftp link */ |
| 41 | + MKDA_EXPLICIT_EMAIL, /* e-mail link with explicit mailto: */ |
| 42 | 42 | MKDA_IMPLICIT_EMAIL /* e-mail link without mailto: */ |
| 43 | 43 | }; |
| 44 | 44 | |
| 45 | 45 | /* mkd_renderer -- functions for rendering parsed data */ |
| 46 | 46 | struct mkd_renderer { |
| | @@ -348,11 +348,11 @@ |
| 348 | 348 | if( i>=size || data[i]!='>' || nb!=1 ) return 0; |
| 349 | 349 | return i+1; |
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | |
| 353 | | -/* tag_length -- returns the length of the given tag, or 0 is it's not valid */ |
| 353 | +/* tag_length -- returns the length of the given tag, or 0 if it's not valid */ |
| 354 | 354 | static size_t tag_length(char *data, size_t size, enum mkd_autolink *autolink){ |
| 355 | 355 | size_t i, j; |
| 356 | 356 | |
| 357 | 357 | /* a valid tag can't be shorter than 3 chars */ |
| 358 | 358 | if( size<3 ) return 0; |
| | @@ -403,11 +403,11 @@ |
| 403 | 403 | }else if( (j = is_mail_autolink(data+i, size-i))!=0 ){ |
| 404 | 404 | *autolink = (i==8) ? MKDA_EXPLICIT_EMAIL : MKDA_IMPLICIT_EMAIL; |
| 405 | 405 | return i+j; |
| 406 | 406 | } |
| 407 | 407 | |
| 408 | | - /* looking for sometinhg looking like a tag end */ |
| 408 | + /* looking for something looking like a tag end */ |
| 409 | 409 | while( i<size && data[i]!='>' ){ i++; } |
| 410 | 410 | if( i>=size ) return 0; |
| 411 | 411 | return i+1; |
| 412 | 412 | } |
| 413 | 413 | |
| | @@ -520,11 +520,11 @@ |
| 520 | 520 | } |
| 521 | 521 | return 0; |
| 522 | 522 | } |
| 523 | 523 | |
| 524 | 524 | |
| 525 | | -/* parse_emph1 -- parsing single emphase */ |
| 525 | +/* parse_emph1 -- parsing single emphasis */ |
| 526 | 526 | /* closed by a symbol not preceded by whitespace and not followed by symbol */ |
| 527 | 527 | static size_t parse_emph1( |
| 528 | 528 | struct Blob *ob, |
| 529 | 529 | struct render *rndr, |
| 530 | 530 | char *data, |
| | @@ -565,11 +565,11 @@ |
| 565 | 565 | } |
| 566 | 566 | return 0; |
| 567 | 567 | } |
| 568 | 568 | |
| 569 | 569 | |
| 570 | | -/* parse_emph2 -- parsing single emphase */ |
| 570 | +/* parse_emph2 -- parsing single emphasis */ |
| 571 | 571 | static size_t parse_emph2( |
| 572 | 572 | struct Blob *ob, |
| 573 | 573 | struct render *rndr, |
| 574 | 574 | char *data, |
| 575 | 575 | size_t size, |
| | @@ -604,11 +604,11 @@ |
| 604 | 604 | } |
| 605 | 605 | return 0; |
| 606 | 606 | } |
| 607 | 607 | |
| 608 | 608 | |
| 609 | | -/* parse_emph3 -- parsing single emphase */ |
| 609 | +/* parse_emph3 -- parsing single emphasis */ |
| 610 | 610 | /* finds the first closing tag, and delegates to the other emph */ |
| 611 | 611 | static size_t parse_emph3( |
| 612 | 612 | struct Blob *ob, |
| 613 | 613 | struct render *rndr, |
| 614 | 614 | char *data, |
| | @@ -777,11 +777,11 @@ |
| 777 | 777 | return 2; |
| 778 | 778 | } |
| 779 | 779 | |
| 780 | 780 | |
| 781 | 781 | /* char_entity -- '&' escaped when it doesn't belong to an entity */ |
| 782 | | -/* valid entities are assumed to be anything mathing &#?[A-Za-z0-9]+; */ |
| 782 | +/* valid entities are assumed to be anything matching &#?[A-Za-z0-9]+; */ |
| 783 | 783 | static size_t char_entity( |
| 784 | 784 | struct Blob *ob, |
| 785 | 785 | struct render *rndr, |
| 786 | 786 | char *data, |
| 787 | 787 | size_t offset, |
| | @@ -1022,11 +1022,11 @@ |
| 1022 | 1022 | if( i+1==id_end ){ |
| 1023 | 1023 | /* implicit id - use the contents */ |
| 1024 | 1024 | id_data = data+1; |
| 1025 | 1025 | id_size = txt_e-1; |
| 1026 | 1026 | }else{ |
| 1027 | | - /* explici id - between brackets */ |
| 1027 | + /* explicit id - between brackets */ |
| 1028 | 1028 | id_data = data+i+1; |
| 1029 | 1029 | id_size = id_end-(i+1); |
| 1030 | 1030 | } |
| 1031 | 1031 | |
| 1032 | 1032 | if( get_link_ref(rndr, link, title, id_data, id_size)<0 ){ |
| | @@ -1138,11 +1138,11 @@ |
| 1138 | 1138 | |
| 1139 | 1139 | return 0; |
| 1140 | 1140 | } |
| 1141 | 1141 | |
| 1142 | 1142 | |
| 1143 | | -/* is_table_sep -- returns wether there is a table separator at the given pos */ |
| 1143 | +/* is_table_sep -- returns whether there is a table separator at pos */ |
| 1144 | 1144 | static int is_table_sep(char *data, size_t pos){ |
| 1145 | 1145 | return data[pos]=='|' && (pos==0 || data[pos-1]!='\\'); |
| 1146 | 1146 | } |
| 1147 | 1147 | |
| 1148 | 1148 | |
| | @@ -1187,11 +1187,11 @@ |
| 1187 | 1187 | return 0; |
| 1188 | 1188 | } |
| 1189 | 1189 | } |
| 1190 | 1190 | |
| 1191 | 1191 | |
| 1192 | | -/* prefix_code -- returns prefix length for block code*/ |
| 1192 | +/* prefix_code -- returns prefix length for block code */ |
| 1193 | 1193 | static size_t prefix_code(char *data, size_t size){ |
| 1194 | 1194 | if( size>0 && data[0]=='\t' ) return 1; |
| 1195 | 1195 | if( size>3 && data[0]==' ' && data[1]==' ' && data[2]==' ' && data[3]==' ' ){ |
| 1196 | 1196 | return 4; |
| 1197 | 1197 | } |
| | @@ -1244,11 +1244,11 @@ |
| 1244 | 1244 | struct render *rndr, |
| 1245 | 1245 | char *data, |
| 1246 | 1246 | size_t size); |
| 1247 | 1247 | |
| 1248 | 1248 | |
| 1249 | | -/* parse_blockquote -- hanldes parsing of a blockquote fragment */ |
| 1249 | +/* parse_blockquote -- handles parsing of a blockquote fragment */ |
| 1250 | 1250 | static size_t parse_blockquote( |
| 1251 | 1251 | struct Blob *ob, |
| 1252 | 1252 | struct render *rndr, |
| 1253 | 1253 | char *data, |
| 1254 | 1254 | size_t size |
| | @@ -1294,11 +1294,11 @@ |
| 1294 | 1294 | release_work_buffer(rndr, out); |
| 1295 | 1295 | return end; |
| 1296 | 1296 | } |
| 1297 | 1297 | |
| 1298 | 1298 | |
| 1299 | | -/* parse_blockquote -- hanldes parsing of a regular paragraph */ |
| 1299 | +/* parse_paragraph -- handles parsing of a regular paragraph */ |
| 1300 | 1300 | static size_t parse_paragraph( |
| 1301 | 1301 | struct Blob *ob, |
| 1302 | 1302 | struct render *rndr, |
| 1303 | 1303 | char *data, |
| 1304 | 1304 | size_t size |
| | @@ -1377,11 +1377,11 @@ |
| 1377 | 1377 | } |
| 1378 | 1378 | return end; |
| 1379 | 1379 | } |
| 1380 | 1380 | |
| 1381 | 1381 | |
| 1382 | | -/* parse_blockquote -- hanldes parsing of a block-level code fragment */ |
| 1382 | +/* parse_blockcode -- handles parsing of a block-level code fragment */ |
| 1383 | 1383 | static size_t parse_blockcode( |
| 1384 | 1384 | struct Blob *ob, |
| 1385 | 1385 | struct render *rndr, |
| 1386 | 1386 | char *data, |
| 1387 | 1387 | size_t size |
| | @@ -1813,11 +1813,11 @@ |
| 1813 | 1813 | size_t i = 0, col = 0; |
| 1814 | 1814 | size_t beg, end, total = 0; |
| 1815 | 1815 | struct Blob *cells = new_work_buffer(rndr); |
| 1816 | 1816 | int align; |
| 1817 | 1817 | |
| 1818 | | - /* skip leading blanks and sperator */ |
| 1818 | + /* skip leading blanks and separator */ |
| 1819 | 1819 | while( i<size && (data[i]==' ' || data[i]=='\t') ){ i++; } |
| 1820 | 1820 | if( i<size && data[i]=='|' ) i++; |
| 1821 | 1821 | |
| 1822 | 1822 | /* go over all the cells */ |
| 1823 | 1823 | while( i<size && total==0 ){ |
| | @@ -2030,11 +2030,11 @@ |
| 2030 | 2030 | static int is_ref( |
| 2031 | 2031 | char *data, /* input text */ |
| 2032 | 2032 | size_t beg, /* offset of the beginning of the line */ |
| 2033 | 2033 | size_t end, /* offset of the end of the text */ |
| 2034 | 2034 | size_t *last, /* last character of the link */ |
| 2035 | | - struct Blob *refs /* arry of link references */ |
| 2035 | + struct Blob *refs /* array of link references */ |
| 2036 | 2036 | ){ |
| 2037 | 2037 | size_t i = 0; |
| 2038 | 2038 | size_t id_offset, id_end; |
| 2039 | 2039 | size_t link_offset, link_end; |
| 2040 | 2040 | size_t title_offset, title_end; |
| 2041 | 2041 | |