Use attribute="..." instead of attribute='...' and encode missing ones. - gopher2html - AWK script that converts a Gopher response to HTML
HTML hg clone https://bitbucket.org/iamleot/gopher2html
DIR Log
DIR Files
DIR Refs
DIR README
---
DIR changeset 942a89bf6b8ef51cf7ba661cba3c4eff6aa437f0
DIR parent c494defbbd94d1badb2dd3fc14c3cb2e87e6ff36
HTML Author: Leonardo Taccari <iamleot@gmail.com>
Date: Wed, 24 Jan 2018 10:10:33
Use attribute="..." instead of attribute='...' and encode missing ones.
Thanks and reported by Hiltjo Posthuma.
Diffstat:
gopher2html.awk | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
---
diff -r c494defbbd94 -r 942a89bf6b8e gopher2html.awk
--- a/gopher2html.awk Wed Jan 24 10:07:32 2018 +0100
+++ b/gopher2html.awk Wed Jan 24 10:10:33 2018 +0100
@@ -80,7 +80,7 @@
}
type == TYPE["file"] || type == TYPE["directory"] {
- printf("<a href='%s'>%s</a>\n", urlize(type, selector, host, port), encode(user_name))
+ printf("<a href=\"%s\">%s</a>\n", urlize(type, selector, host, port), encode(user_name))
}
type == TYPE["error"] {
@@ -88,7 +88,7 @@
}
type == TYPE["search"] {
- printf("<form action='%s'>", urlize(type, selector, host, port))
+ printf("<form action=\"%s\">", urlize(type, selector, host, port))
printf("<input type='text' />")
printf("<input type='submit' />")
printf("</form>\n")
@@ -100,12 +100,12 @@
type == TYPE["html"] {
url = substr(selector, 5) # strip `URL:' prefix
- printf("<a href='%s'>%s</a>\n", url, encode(user_name))
+ printf("<a href=\"%s\">%s</a>\n", encode(url), encode(user_name))
}
type == TYPE["picture"] {
- printf("<img src='%s' alt='%s' />\n",
- urlize(type, selector, host, port), user_name)
+ printf("<img src=\"%s\" alt=\"%s\" />\n",
+ urlize(type, selector, host, port), encode(user_name))
}
END {