From 61247f6a328b7f6cc36272725362d0d5c57d6956 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Fri, 2 Jul 2021 22:13:09 +0200 Subject: [PATCH] [text/gemini] Do not expect space --- src/document/gemini/renderer.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/document/gemini/renderer.c b/src/document/gemini/renderer.c index 7fe4cbc7..84bcbfbf 100644 --- a/src/document/gemini/renderer.c +++ b/src/document/gemini/renderer.c @@ -37,37 +37,37 @@ static void convert_single_line(struct string *ret, struct string *line) { - if (line->length >= 4 && !strncmp(line->source, "### ", 4)) { + if (line->length >= 3 && !strncmp(line->source, "###", 3)) { add_to_string(ret, "

"); - add_html_to_string(ret, line->source + 4, line->length - 4); + add_html_to_string(ret, line->source + 3, line->length - 3); add_to_string(ret, "

"); return; } - if (line->length >= 3 && !strncmp(line->source, "## ", 3)) { + if (line->length >= 2 && !strncmp(line->source, "##", 2)) { add_to_string(ret, "

"); - add_html_to_string(ret, line->source + 3, line->length - 3); + add_html_to_string(ret, line->source + 2, line->length - 2); add_to_string(ret, "

"); return; } - if (line->length >= 2 && !strncmp(line->source, "# ", 2)) { + if (line->length >= 1 && !strncmp(line->source, "#", 1)) { add_to_string(ret, "

"); - add_html_to_string(ret, line->source + 2, line->length - 2); + add_html_to_string(ret, line->source + 1, line->length - 1); add_to_string(ret, "

"); return; } - if (line->length >= 2 && !strncmp(line->source, "* ", 2)) { + if (line->length >= 2 && !strncmp(line->source, "*", 1)) { add_to_string(ret, "
  • "); - add_html_to_string(ret, line->source + 2, line->length - 2); + add_html_to_string(ret, line->source + 1, line->length - 1); add_to_string(ret, "
  • "); return; } - if (line->length >= 2 && !strncmp(line->source, "> ", 2)) { + if (line->length >= 1 && !strncmp(line->source, ">", 1)) { add_to_string(ret, "
    "); - add_html_to_string(ret, line->source + 2, line->length - 2); + add_html_to_string(ret, line->source + 1, line->length - 1); add_to_string(ret, "
    "); return; }