From 4ec62574117ee07d4f4a461860f4b87510850381 Mon Sep 17 00:00:00 2001 From: sejo Date: Thu, 20 May 2021 15:48:31 -0500 Subject: =?UTF-8?q?nombre2link=20funci=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gemtext2html.awk | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'gemtext2html.awk') 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 -- cgit v1.2.3