diff options
Diffstat (limited to 'examples/cgit-commit-filter.lua')
-rw-r--r-- | examples/cgit-commit-filter.lua | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/examples/cgit-commit-filter.lua b/examples/cgit-commit-filter.lua index 73af9948..9857b3c9 100644 --- a/examples/cgit-commit-filter.lua +++ b/examples/cgit-commit-filter.lua @@ -1,4 +1,4 @@ --- Copyright (C) 2015-2020 all contributors <meta@public-inbox.org> +-- Copyright (C) 2015-2021 all contributors <meta@public-inbox.org> -- License: GPLv2 or later <https://www.gnu.org/licenses/gpl-2.0.txt> -- This commit filter maps a subject line to a search URL of a public-inbox -- disclaimer: written by someone who does not know Lua. @@ -31,11 +31,13 @@ function filter_close() if u == nil then html(buffer) else - html('<a href="' .. u .. '?x=t&q=') - html_url_arg('"' .. buffer .. '"') - html('"><tt>') + html("<a\ntitle='mail thread'\n") + html('href="' .. u .. '?x=t&q=') + s = string.gsub(buffer, '"', '""') + html_url_arg('"' .. s .. '"') + html('">') html_txt(buffer) - html('</tt></a>') + html('</a>') end else -- pass the body-through as-is |