about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorChristian Hesse2014-01-14 12:01:58 +0100
committerJason A. Donenfeld2014-01-14 13:55:44 +0100
commit1167dbb95bcd6bb2916312a7900e360c101e7eca (patch)
treec7d544f39259a6679727773e4b335b9548783518
parentemail-gravatar.py: fix UTF-8 (diff)
downloadcgit-1167dbb95bcd6bb2916312a7900e360c101e7eca.tar.gz
cgit-1167dbb95bcd6bb2916312a7900e360c101e7eca.zip
email-gravatar: fix html syntax issues
* make ampersand a html entity
* add required alt attribute
* add required img end tag
-rw-r--r--filters/email-gravatar.lua2
-rwxr-xr-xfilters/email-gravatar.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/filters/email-gravatar.lua b/filters/email-gravatar.lua index 9feb611..22f0641 100644 --- a/filters/email-gravatar.lua +++ b/filters/email-gravatar.lua
@@ -15,7 +15,7 @@ function filter_open(email, page)
15end 15end
16 16
17function filter_close() 17function filter_close()
18 html("<img src='//www.gravatar.com/avatar/" .. md5 .. "?s=13&d=retro' style='height:10pt;width:10pt'> " .. buffer) 18 html("<img src='//www.gravatar.com/avatar/" .. md5 .. "?s=13&amp;d=retro' style='height:10pt;width:10pt' alt='Gravatar' /> " .. buffer)
19end 19end
20 20
21function filter_write(str) 21function filter_write(str)
diff --git a/filters/email-gravatar.py b/filters/email-gravatar.py index 5d08ea8..97f21cf 100755 --- a/filters/email-gravatar.py +++ b/filters/email-gravatar.py
@@ -36,4 +36,4 @@ sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach())
36md5 = hashlib.md5(email.encode()).hexdigest() 36md5 = hashlib.md5(email.encode()).hexdigest()
37text = sys.stdin.read().strip() 37text = sys.stdin.read().strip()
38 38
39print("<img src='//www.gravatar.com/avatar/" + md5 + "?s=13&d=retro' style='height:10pt;width:10pt'> " + text) 39print("<img src='//www.gravatar.com/avatar/" + md5 + "?s=13&amp;d=retro' style='height:10pt;width:10pt' alt='Gravatar' /> " + text)