aboutsummaryrefslogtreecommitdiffstats
path: root/gemtext2html.awk
diff options
context:
space:
mode:
authorsejo <sejo@texto-plano.xyz>2021-05-20 15:48:31 -0500
committersejo <sejo@texto-plano.xyz>2021-05-20 15:48:31 -0500
commit4ec62574117ee07d4f4a461860f4b87510850381 (patch)
tree3776becdc82628db97e548447581253db971232a /gemtext2html.awk
parent126143db0190a88e708d930c21005e1f70b0e001 (diff)
downloadsitio-4ec62574117ee07d4f4a461860f4b87510850381.tar.gz
nombre2link función
Diffstat (limited to 'gemtext2html.awk')
-rw-r--r--gemtext2html.awk8
1 files changed, 7 insertions, 1 deletions
diff --git a/gemtext2html.awk b/gemtext2html.awk
index 5549c95..45980bd 100644
--- a/gemtext2html.awk
+++ b/gemtext2html.awk
@@ -47,7 +47,7 @@ function wikiLink( t ){
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
- gsub(" ","_",nombre) # reemplaza espacios por _
+ nombre = nombre2Link( nombre, "_" )
post = substr(t, ifinal+1) # string posterior
@@ -58,6 +58,12 @@ function wikiLink( t ){
}
}
+function nombre2Link( t, r ){ # convierte un nombre con espacios, a uno con r (e.g. "_"
+ gsub(" ",r,t);
+ return t
+}
+
+
NR == 1{
titulo = $0
sub("#[[:blank:]]+","",titulo) #prefijo
Un proyecto texto-plano.xyz