diff --git a/gmo2gmi.awk b/gmo2gmi.awk index d92f07b..fd17ade 100644 --- a/gmo2gmi.awk +++ b/gmo2gmi.awk @@ -14,10 +14,8 @@ function nombre2Link( t, r ){ # convierte un nombre con espacios, a uno con r (e } -# imprime líneas normamlmente - -{ - print $0 +/^=>/{ # link + gsub(/[{}]/,"") } # si tienen sintaxis de wikilink, y no son líneas de enlace, agrega el link @@ -28,9 +26,18 @@ function nombre2Link( t, r ){ # convierte un nombre con espacios, a uno con r (e link = substr($0, i, ifinal-i+1) # {link} nombre = substr($0, i+1, ifinal-i-1) # link - nombre = nombre2Link( nombre, "_" ) + filename = nombre2Link( nombre, "_" ) - print "=> ./" nombre ".gmi " link + gsub(/[{}]/,"") + print $0 + print "=> ./" filename ".gmi " nombre + next +} + +# imprime líneas normamlmente + +{ + print $0 } # agrega footer