aboutsummaryrefslogtreecommitdiffstats
path: root/gemtext2html.awk
diff options
context:
space:
mode:
authorsejo <sejo@texto-plano.xyz>2021-05-20 17:10:49 -0500
committersejo <sejo@texto-plano.xyz>2021-05-20 17:10:49 -0500
commit27a2164dffe2352e6975866993d21d0196a09271 (patch)
tree889843872a0d6bf0bb65b854f58bb1cb5255884f /gemtext2html.awk
parentd56efec8de064ae4af532177a7c403d65b69b450 (diff)
downloadsitio-27a2164dffe2352e6975866993d21d0196a09271.tar.gz
reemplaza < > por html entities
Diffstat (limited to 'gemtext2html.awk')
-rw-r--r--gemtext2html.awk7
1 files changed, 5 insertions, 2 deletions
diff --git a/gemtext2html.awk b/gemtext2html.awk
index 5162d17..ab4d44e 100644
--- a/gemtext2html.awk
+++ b/gemtext2html.awk
@@ -2,6 +2,7 @@
# convierte un archivo en gemtext a html de acuerdo a la spec
# excepción: enlaces a imagen (jpg, png, gif) se vuelven <img>
# TODO actualizar descripción
+# TODO h2 en nav?
#
# importante: solo un {wikilink} (con o sin espacios) por línea
#
@@ -10,7 +11,7 @@
#
BEGIN{
- sitio = "HOLO"
+ sitio = "🥭"
# para poder abrir y cerrar <ul>, <pre>, <p>:
modo_lista = 0
modo_pre = 0
@@ -24,7 +25,7 @@ BEGIN{
bloque = 0 # para no agregar <br/> después de headers y blockquotes
print "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>"
- print "<html xmlns='http://www.w3.org/1999/xhtml' lang='es-MX'>"
+ print "<html xmlns='http://www.w3.org/1999/xhtml' lang='es-MX,en'>"
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'/>"
@@ -290,6 +291,8 @@ NR == 1{
appendContenido( wikiLink($0) )
}
else{
+ gsub("<","\\&lt;",$0)
+ gsub(">","\\&gt;",$0)
appendContenido( $0 )
}
}
Un proyecto texto-plano.xyz