remove {} from links

This commit is contained in:
sejo 2021-11-05 19:28:14 -06:00
parent e514edf6ec
commit 0666e50f3c
1 changed files with 13 additions and 6 deletions

View File

@ -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