Welcome to little lamb

Code » qmdoc » commit c951cb8

Fix <h2> not closed when --subtitle is used

author Olivier Brunel
2023-01-14 19:13:25 UTC
committer Olivier Brunel
2023-01-14 19:13:25 UTC
parent b87cb45af2ea1ff688bd5e669481484fc42fd77a

Fix <h2> not closed when --subtitle is used

src/main.c +2 -1

diff --git a/src/main.c b/src/main.c
index 716f347..b7e5924 100644
--- a/src/main.c
+++ b/src/main.c
@@ -401,7 +401,8 @@ enter_block(MD_BLOCKTYPE type, void *details, void *ctx_)
                         || (ctx->doc.subtitle && (!raw_str(ctx, "<h2>")
                                                   || !escape_text(ctx,
                                                                   ctx->doc.subtitle,
-                                                                  strlen(ctx->doc.subtitle)))
+                                                                  strlen(ctx->doc.subtitle))
+                                                  || !raw_str(ctx, "</h2>"))
                             )
                         || !raw_str(ctx, "</section><nav><ul>"))
                         return ERR_PARSER_ENTER_BLOCK;