reemplaza espacios por _ en wikilinks

This commit is contained in:
sejo 2021-05-19 21:32:26 -05:00
parent 5e965ffa80
commit 9b061476ed
1 changed files with 4 additions and 0 deletions

View File

@ -21,6 +21,8 @@ BEGIN{
print "<head>"
print "<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />"
print "<meta content='initial-scale=1.0, maximum-scale=1.0, user-scalable=yes' name='viewport'/>"
print "<link rel='stylesheet' href='./static/estilo.css'>"
print "</head><body>"
contenido = "<main><section>"
nav = "<nav><ul>"
@ -41,6 +43,8 @@ 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 _
post = substr(t, ifinal+1) # string posterior
return prev "<a href='./" nombre ".html'>" link "</a>" post