slweb

Једноставни генератор статичких веб страна
git clone https://git.sr.ht/~strahinja/slweb
Дневник | Датотеке | Референце | ПРОЧИТАЈМЕ | ЛИЦЕНЦА

чување d4d6f980b1438e28f67f957ea4ce309c326a6ad4
родитељ 7e52ac3005b71e688d342bf395b5896c8d81f10a
Аутор: Страхиња Радић <contact@strahinja.org>
Датум:   Thu, 28 Sep 2023 15:10:34 +0200

Merge branch 'master' of git.sr.ht:~strahinja/slweb

Diffstat:
Mslweb.c | 64++++------------------------------------------------------------
измењених датотека: 1, додавања: 4(+), брисања: 60(-)

diff --git a/slweb.c b/slweb.c @@ -1490,11 +1490,7 @@ int process_list_item_end(FILE* output) { if (IN(state, ST_PARA_OPEN)) - { state &= ~ST_PARA_OPEN; - print_output(output, "</p>"); - output_firstcol = 0; - } print_output(output, "</li>"); output_firstcol = 0; return 0; @@ -2189,7 +2185,7 @@ process_madeby(FILE* output) "<div id=\"made-by\"><p><small>\n" "Generated by <a href=\"%s\">slweb</a>\n" "© %s Strahinya Radich.\n" - "</small></p></div><!--made-by-->\n", + "</small></div><!--made-by-->\n", MADEBY_URL, COPYRIGHTYEAR); return 0; } @@ -2414,15 +2410,7 @@ process_line_start(FILE* output, const u8* line, const u8* link_prefix, } if (IN(state, ST_FOOTNOTE_TEXT)) - { - if (!read_yaml_macros_and_links - && (IN(state, ST_PARA_OPEN))) - { - print_output(output, "</p>\n"); - output_firstcol = 1; - } state &= ~(ST_FOOTNOTE_TEXT | ST_PARA_OPEN); - } } if (new_para_ok && !ANY(state, @@ -2560,9 +2548,6 @@ process_footnote(FILE* output, const u8* token, const int footnote_definition, int process_horizontal_rule(FILE* output) { - /* Temporarily break paragraph as hr is para-level */ - if (IN(state, ST_PARA_OPEN)) - print_output(output, "</p>\n"); print_output(output, "<hr>\n"); if (IN(state, ST_PARA_OPEN)) print_output(output, "<p>\n"); @@ -2721,7 +2706,7 @@ begin_article(FILE* output, const char* source_filename, const u8* link_prefix, title_heading_level ? title_heading_level : "2"); if (header_text) - print_output(output, "<p>%s</p>\n", (char*)header_text); + print_output(output, "<p>%s\n", (char*)header_text); if (author) print_output(output, "<address>%s</address>\n", author); @@ -2762,11 +2747,7 @@ end_footnotes(FILE* output, int add_footnote_div) size_t footnote = 0; if (IN(state, ST_PARA_OPEN)) - { - print_output(output, "</p>\n"); - output_firstcol = 1; state &= ~ST_PARA_OPEN; - } if (add_footnote_div) { @@ -2781,7 +2762,7 @@ end_footnotes(FILE* output, int add_footnote_div) print_output(output, "<p id=\"inline-footnote-%d\">" "<a href=\"#inline-footnote-text-%d\">%d.</a> " - "%s</p>\n", + "%s\n", footnote + 1, footnote + 1, footnote + 1, (char*)inline_footnotes[footnote]); output_firstcol = 1; @@ -2793,7 +2774,7 @@ end_footnotes(FILE* output, int add_footnote_div) { print_output(output, "<p id=\"footnote-%d\">" - "<a href=\"#footnote-text-%d\">%d.</a> %s</p>\n", + "<a href=\"#footnote-text-%d\">%d.</a> %s\n", footnote + 1, footnote + 1, footnote + 1, (char*)pfootnote->value); output_firstcol = 1; @@ -3097,11 +3078,6 @@ do_line: &ptoken, &token_size, 1, 1); processed_start_of_line = 1; - /* <p> without </p> is allowed in HTML spec */ - /*if (!read_yaml_macros_and_links - && IN(state, ST_PARA_OPEN)) - print_output(output, "</p>\n");*/ - state &= ~(ST_SUMMARY | ST_PARA_OPEN); pline += 2; @@ -3320,10 +3296,7 @@ do_line: if (IN(state, ST_PRE)) { if (IN(state, ST_PARA_OPEN)) - { - print_output(output, "</p>\n"); state &= ~ST_PARA_OPEN; - } print_output(output, "<pre>"); } else @@ -3963,14 +3936,7 @@ do_line: if (break_mark) { if (IN(state, ST_PARA_OPEN)) - { - if (!read_yaml_macros_and_links) - { - print_output(output, "</p>\n"); - output_firstcol = 1; - } state &= ~ST_PARA_OPEN; - } if (IN(state, ST_LIST)) { state &= ~ST_LIST; @@ -4273,10 +4239,7 @@ do_line: && !(IN(state, ST_BLOCKQUOTE))) { if (IN(state, ST_PARA_OPEN)) - { - print_output(output, "</p>\n"); state &= ~ST_PARA_OPEN; - } process_blockquote(output, 0); output_firstcol = 0; } @@ -4377,15 +4340,7 @@ do_line: } if (IN(state, ST_FOOTNOTE_TEXT)) - { - if (!read_yaml_macros_and_links - && (IN(state, ST_PARA_OPEN))) - { - print_output(output, "</p>\n"); - output_firstcol = 1; - } state &= ~(ST_FOOTNOTE_TEXT | ST_PARA_OPEN); - } if (pline_len > 1 && *(pline + 1) == '^') { @@ -4527,10 +4482,7 @@ do_line: { if (add_figcaption && IN(state, ST_PARA_OPEN)) - { - print_output(output, "</p>\n"); state &= ~ST_PARA_OPEN; - } process_inline_image(output, link_text, image_file_prefix, link_prefix, @@ -4619,10 +4571,7 @@ do_line: if (!read_yaml_macros_and_links) { if (add_figcaption && IN(state, ST_PARA_OPEN)) - { - print_output(output, "</p>\n"); state &= ~ST_PARA_OPEN; - } process_image(output, link_text, image_file_prefix, link_prefix, token, @@ -5127,11 +5076,6 @@ done_line: { if (IN(state, ST_PARA_OPEN)) { - if (!read_yaml_macros_and_links) - { - print_output(output, "</p>"); - output_firstcol = 0; - } if (IN(state, ST_LIST)) skip_eol = 1; state &= ~ST_PARA_OPEN;