From 7d3ec1feb8bfa4ddbe555a6e029c05c525722c6a Mon Sep 17 00:00:00 2001 From: dx Date: Thu, 7 May 2020 01:20:37 +0100 Subject: ~puting branching comments on the line they reference --- Converter/src/compiler.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'Converter') 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 = "
  • "; string close_tag = "
  • "; @@ -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); } -- cgit v1.2.3-13-gbd6f