]> Sergey Matveev's repositories - public-inbox.git/blobdiff - examples/cgit-commit-filter.lua
nntp: use substr to check for trailing CRLF
[public-inbox.git] / examples / cgit-commit-filter.lua
index 8f9d3eb51d0d362814733449eacef1adf5660203..9857b3c9572a33a0a3e7723f96a0de5e753a6bba 100644 (file)
@@ -31,11 +31,13 @@ function filter_close()
                if u == nil then
                        html(buffer)
                else
-                       html('<a href="' .. u .. '?x=t&amp;q=')
-                       html_url_arg('"' .. buffer .. '"')
-                       html('"><tt>')
+                       html("<a\ntitle='mail thread'\n")
+                       html('href="' .. u .. '?x=t&amp;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