From d28a7889b43ecbca936784f6913a3f86bf0e4271 Mon Sep 17 00:00:00 2001 From: sejo Date: Sat, 8 Jan 2022 11:59:43 -0600 Subject: [PATCH] posix compatible awk --- gemtext2html.awk | 16 ++++++++-------- genlog.awk | 6 +++--- gmo2gmi.awk | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/gemtext2html.awk b/gemtext2html.awk index 4448b33..98580a8 100644 --- a/gemtext2html.awk +++ b/gemtext2html.awk @@ -55,7 +55,7 @@ function appendNav( t ){ } function wikiLink( t ){ - i = match( t, /{.+}/) + i = match( t, /\{.+\}/) if ( i ){ ifinal = index(t, "}") # índice del } final @@ -109,8 +109,8 @@ NR == 1{ -/^\+ /{ # include literal - sub(/^+ /,"",$0) # elimina el + +sub(/^\+[[:blank:]]+/,""){ # include literal +# sub(/^+ /,"",$0) # elimina el + appendContenido( $0 ) next } @@ -183,8 +183,8 @@ NR == 1{ sub(".gmi$",".html",$1) # quita { } - sub("{","",texto) - sub("}","",texto) + sub(/\{/,"",texto) + sub(/\}/,"",texto) # crea link appendContenido("

"texto"

") @@ -203,7 +203,7 @@ NR == 1{ next } -/^* /{ # lista +/^\* /{ # lista if(!modo_pre){ if(!modo_lista){ # inicia la lista if(modo_parrafo){ @@ -213,8 +213,8 @@ NR == 1{ modo_lista = 1 appendContenido( "