diff options
author | dx <aryadevchavali1@gmail.com> | 2020-05-07 01:20:37 +0100 |
---|---|---|
committer | dx <aryadevchavali1@gmail.com> | 2020-05-07 01:20:37 +0100 |
commit | 7d3ec1feb8bfa4ddbe555a6e029c05c525722c6a (patch) | |
tree | 6d341c92d473fdadb7a36473434dc7d8d585a895 /Converter/src/compiler.c | |
parent | ec7f4c70338ffe9e0226300d71336fe916df2db0 (diff) | |
download | mdhtml-7d3ec1feb8bfa4ddbe555a6e029c05c525722c6a.tar.gz mdhtml-7d3ec1feb8bfa4ddbe555a6e029c05c525722c6a.tar.bz2 mdhtml-7d3ec1feb8bfa4ddbe555a6e029c05c525722c6a.zip |
~puting branching comments on the line they reference
Diffstat (limited to 'Converter/src/compiler.c')
-rw-r--r-- | Converter/src/compiler.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/Converter/src/compiler.c b/Converter/src/compiler.c index b7e1871..63f86ed 100644 --- a/Converter/src/compiler.c +++ b/Converter/src/compiler.c @@ -109,8 +109,7 @@ string compile_line(string line, size_t size_of_line, string line_or_source) string compiled_line; size_t size_of_content; - // Compile a header - if (line[0] == '#') + if (line[0] == '#') // Compile a header { // Get the level of header (h1, h2, etc) int depth; @@ -136,8 +135,7 @@ string compile_line(string line, size_t size_of_line, string line_or_source) strncpy(compiled_line + size_of_content + tag_size - 1, close_tag, close_tag_size + 1); } - // Compile a list item - else if (line[0] == '-') + else if (line[0] == '-') // Compile a list item { string tag = "<li>"; string close_tag = "</li>"; @@ -148,10 +146,8 @@ string compile_line(string line, size_t size_of_line, string line_or_source) strncpy(compiled_line + 4, line + 1, size_of_line); strncpy(compiled_line + size_of_content + 4, close_tag, 5); } - // Compile a standard piece of text - else + else // Compile a standard piece of text { - // Assume standard text compiled_line = malloc(sizeof(*compiled_line) * size_of_line * 2); compile_inner_text(compiled_line, line, size_of_line, line_or_source); } |