conversión de {links}
This commit is contained in:
parent
890247d348
commit
00b9fd4d76
|
@ -33,6 +33,23 @@ function appendNav( t ){
|
|||
nav = nav t
|
||||
}
|
||||
|
||||
function wikiLink( t ){
|
||||
i = match( t, /{.+}/)
|
||||
if ( i ){
|
||||
ifinal = index(t, "}") # índice del } final
|
||||
|
||||
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
|
||||
post = substr(t, ifinal+1) # string posterior
|
||||
|
||||
return prev "<a href='" nombre ".html'>" link "</a>" post
|
||||
}
|
||||
else{
|
||||
return t
|
||||
}
|
||||
}
|
||||
|
||||
NR == 1{
|
||||
titulo = $0
|
||||
sub("#[[:blank:]]+","",titulo) #prefijo
|
||||
|
@ -57,8 +74,11 @@ $0 !~ /^(=>|```|#{1,3} |* |>|[[:blank:]]*$)/{ # líneas de texto (no "especiales
|
|||
else # nueva línea en el mismo párrafo
|
||||
appendContenido( "<br/>" )
|
||||
|
||||
appendContenido( wikiLink($0) )
|
||||
}
|
||||
else{
|
||||
appendContenido( $0 )
|
||||
}
|
||||
appendContenido( $0 )
|
||||
}
|
||||
|
||||
/^[[:blank:]]*$/ { # línea vacía
|
||||
|
@ -130,8 +150,11 @@ $0 !~ /^(=>|```|#{1,3} |* |>|[[:blank:]]*$)/{ # líneas de texto (no "especiales
|
|||
}
|
||||
sub("*[[:blank:]]+","<li>",$0)
|
||||
sub("$","</li>",$0)
|
||||
appendContenido( $0 )
|
||||
}
|
||||
else{
|
||||
appendContenido( $0 )
|
||||
}
|
||||
appendContenido( $0 )
|
||||
}
|
||||
|
||||
/^```/{ # preformatted
|
||||
|
|
Loading…
Reference in New Issue