From a190c3707b5e31a11890af657f96960b05d5f38e Mon Sep 17 00:00:00 2001 From: sejo Date: Wed, 19 May 2021 20:24:33 -0500 Subject: =?UTF-8?q?no=20agregues=20enlace=20si=20ya=20es=20l=C3=ADnea=20de?= =?UTF-8?q?=20link?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gem2gem.awk | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) (limited to 'gem2gem.awk') diff --git a/gem2gem.awk b/gem2gem.awk index 1ede906..e289f35 100644 --- a/gem2gem.awk +++ b/gem2gem.awk @@ -1,25 +1,12 @@ -function wikiLink( t ){ - i = match( t, /{.+}/) - if ( i ){ - ifinal = index(t, "}") # índice del } final - prev = substr(t, 1, i-1) # string previa al link - link = substr(t, i, ifinal-i+1) # {link} - nombre = substr(t, i+1, ifinal-i-1) # link - post = substr(t, ifinal+1) # string posterior +# imprime líneas normamlmente - return "=> " nombre ".gmi " link - } - else{ - return t - } -} - -{ +{ print $0 } -/{.+}/{ +# si tienen sintaxis de wikilink, y no son líneas de enlace, agrega el link +/^[^=].+{.+}/{ i = match( $0, /{.+}/) ifinal = index($0, "}") # índice del } final @@ -30,6 +17,8 @@ function wikiLink( t ){ print "=> " nombre ".gmi " link } +# agrega footer + END{ print "" print "página actualizada en: " -- cgit v1.2.3