From 38a33534cfb53885ac21ade9fc88b10477e48e57 Mon Sep 17 00:00:00 2001 From: sejo Date: Thu, 20 May 2021 15:50:41 -0500 Subject: h2 y h3 con id --- gemtext2html.awk | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'gemtext2html.awk') diff --git a/gemtext2html.awk b/gemtext2html.awk index 45980bd..ef40384 100644 --- a/gemtext2html.awk +++ b/gemtext2html.awk @@ -248,20 +248,27 @@ $0 !~ /^(=>|```|#{1,3} |* |>|[[:blank:]]*$)/{ # lĂ­neas de texto (no "especiales /^## /{ # h2 if(!modo_pre){ - sub("##[[:blank:]]+","

",$0) - sub("$","

",$0) + sub("##[[:blank:]]+","",$0) + sub("$","",$0) + # crea header con id + appendContenido( "

"$0"

" ) bloque = 1 } - appendContenido( $0 ) + else{ + appendContenido( $0 ) + } } /^### /{ # h3 if(!modo_pre){ - sub("###[[:blank:]]+","

",$0) - sub("$","

",$0) + sub("###[[:blank:]]+","",$0) + sub("$","",$0) + appendContenido( "

"$0"

" ) bloque = 1 } - appendContenido( $0 ) + else{ + appendContenido( $0 ) + } } END{ -- cgit v1.2.3