X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=include%2Fparser.h;h=23cd12f625ff2e668c6aa2d793203d375916aa1a;hb=4b8ad1b3b464836eca2e876dd418a8e8d87bd721;hp=2690b20e27f9747a3e3338eb6e907d2238cd3f2c;hpb=d4843ea375360f37e965709e73c0fbd68e302dca;p=smdp.git diff --git a/include/parser.h b/include/parser.h index 2690b20..23cd12f 100644 --- a/include/parser.h +++ b/include/parser.h @@ -28,6 +28,7 @@ * function: markdown_analyse which is used to identify line wide formating * rules in given line * function: markdown_debug to print a report of the generated data structure + * function: adjust_line_length to calculate line length excluding markup * function: is_utf8 detects multi-byte char * function: length_utf8 calculates the amount of bytes used for a multi-byte * char @@ -35,17 +36,20 @@ * */ +#include "common.h" #include "markdown.h" +#include "cstack.h" #define EXPAND_TABS 4 #define CODE_INDENT 4 +#define UNORDERED_LIST_MAX_LEVEL 3 deck_t *markdown_load(FILE *input); -int markdown_analyse(cstring_t *text); +int markdown_analyse(cstring_t *text, int prev); void markdown_debug(deck_t *deck, int debug); -int is_utf8(char ch); -int length_utf8(char ch); +void adjust_line_length(line_t *line); int next_nonblank(cstring_t *text, int i); +int prev_blank(cstring_t *text, int i); int next_blank(cstring_t *text, int i); int next_word(cstring_t *text, int i);