X-Git-Url: https://git.danieliu.xyz/?p=smdp.git;a=blobdiff_plain;f=src%2Fparser.c;h=c04faccf8ec2af3801698aa9959442908854eedd;hp=a573106888282a4b060fed5cd4398de3185de418;hb=a1d883fc5b7acbf45fdc80a7806b4d4c21fdcd1f;hpb=618df4fd72bc78c3012a0987ab9e7183a404b20c diff --git a/src/parser.c b/src/parser.c index a573106..c04facc 100644 --- a/src/parser.c +++ b/src/parser.c @@ -302,11 +302,12 @@ int markdown_analyse(cstring_t *text) { // strip trailing spaces for(eol = text->size; eol > offset && isspace((unsigned char) text->text[eol - 1]); eol--); + // IS_UNORDERED_LIST_# if(text->size >= offset + 2 && (text->text[offset] == '*' || text->text[offset] == '-') && text->text[offset + 1] == ' ') { - for(i = offset; itext[i] != '*' && text->text[i] != '-' && text->text[i] != ' ') { @@ -328,7 +329,7 @@ int markdown_analyse(cstring_t *text) { if(unordered_list_level == 0) { unordered_list_level = 1; unordered_list_level_offset[1] = offset; - } + } switch(unordered_list_level) { case 1: SET_BIT(bits, IS_UNORDERED_LIST_1); break; @@ -339,6 +340,7 @@ int markdown_analyse(cstring_t *text) { break; } + } } if(!CHECK_BIT(bits, IS_UNORDERED_LIST_1) && @@ -347,9 +349,10 @@ int markdown_analyse(cstring_t *text) { unordered_list_level = 0; + // IS_CODE if(offset >= CODE_INDENT) { - // IS_CODE SET_BIT(bits, IS_CODE); + } else { for(i = offset; i < eol; i++) {