Welcome to little lamb

Code » qmdoc » commit c4a1291

Add a #top marker

author Olivier Brunel
2023-07-05 07:46:54 UTC
committer Olivier Brunel
2023-07-07 16:59:36 UTC
parent c23250f23acfb9dd817f12006ce8277c09e6491a

Add a #top marker

In case e.g. via custom header/footer, one would like to add a link to
the top of the page.

src/qmdoc/qmdoc.c +1 -1

diff --git a/src/qmdoc/qmdoc.c b/src/qmdoc/qmdoc.c
index 80675f5..b77ded6 100644
--- a/src/qmdoc/qmdoc.c
+++ b/src/qmdoc/qmdoc.c
@@ -564,7 +564,7 @@ enter_block(MD_BLOCKTYPE type, void *details, void *ctx_)
                         return ERR_ENTER_BLOCK;
                 }
 
-                if (!raw_str(ctx, "<section class=\"content\">")
+                if (!raw_str(ctx, "<section class=\"content\"><a name=\"top\"></a>")
                         || (ctx->doc.oheader && !(ctx->options & OPT_WIDE_INC)
                             && !raw_str(ctx, ctx->sa.s + ctx->doc.oheader)))
                     return ERR_ENTER_BLOCK;