diff options
-rw-r--r-- | gemtext2html.awk | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gemtext2html.awk b/gemtext2html.awk index 0fa9326..d81c991 100644 --- a/gemtext2html.awk +++ b/gemtext2html.awk @@ -17,7 +17,9 @@ BEGIN{ modo_parrafo = 0 modo_galeria = 0 - en_section = 1 + en_section = 1 #empezamos abriendo una <section> sin h1 + + navcount = 0 bloque = 0 # para no agregar <br/> después de headers y blockquotes @@ -37,6 +39,7 @@ function appendContenido( t ){ } function appendNav( t ){ nav = nav t "\n" + navcount++ } function wikiLink( t ){ @@ -82,7 +85,7 @@ NR == 1{ -/^\+/{ # include literal +/^\+ /{ # include literal sub(/^+ /,"",$0) # elimina el + appendContenido( $0 ) next @@ -293,8 +296,10 @@ NR == 1{ END{ # imprime y cierra nav - print nav - print "</ul></nav>" + if(navcount){ + print nav + print "</ul></nav>" + } # imprime contenido print contenido |