From eb41e8b03bbcba93d23d04cb616e1400e4ff204e Mon Sep 17 00:00:00 2001 From: sejo Date: Wed, 19 May 2021 20:31:57 -0500 Subject: =?UTF-8?q?agrega=20decisi=C3=B3n=20para=20links=20locales?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gemtext2html.awk | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'gemtext2html.awk') diff --git a/gemtext2html.awk b/gemtext2html.awk index f2739ea..02271cf 100644 --- a/gemtext2html.awk +++ b/gemtext2html.awk @@ -43,7 +43,7 @@ function wikiLink( t ){ nombre = substr(t, i+1, ifinal-i-1) # link post = substr(t, ifinal+1) # string posterior - return prev "" link "" post + return prev "" link "" post } else{ return t @@ -121,18 +121,20 @@ $0 !~ /^(=>|```|#{1,3} |* |>|[[:blank:]]*$)/{ # líneas de texto (no "especiales texto = texto" "$i } - # si el path es imagen - if( match($1, /(png|jpg|gif)$/) ){ - # crea imagen - $0=""texto"" - } - # si el path no es imagen - else{ - # convierte enlace de .gmi a .html ! - sub(".gmi$",".html",$1) + if( match($1, /^\.\//)) { # si es link local + # si el path es imagen + if( match($1, /(png|jpg|gif)$/) ){ + # crea imagen + $0=""texto"" + } + # si el path no es imagen + else{ + # convierte enlace de .gmi a .html ! + sub(".gmi$",".html",$1) - # crea link - $0=""texto"
" + # crea link + $0="

"texto"

" + } } } appendContenido( $0 ) @@ -235,7 +237,7 @@ END{ print nav print "" print contenido - # cierra tags que pudiero n haber quedado abiertas + # cierra tags que pudieron haber quedado abiertas if(modo_pre) print "" else if(modo_parrafo) @@ -249,7 +251,7 @@ END{ print "

página actualizada en: " fecha = system( "date -r " FILENAME " --rfc-3339=date" ) print "

" - + print "

inicio

" print "" print "" print "" -- cgit v1.2.3