]> Sergey Matveev's repositories - public-inbox.git/commitdiff
examples: cgit-commit-filter: drop <tt> HTML tag, use title=
authorEric Wong <e@80x24.org>
Fri, 19 Mar 2021 04:18:54 +0000 (04:18 +0000)
committerEric Wong <e@80x24.org>
Fri, 19 Mar 2021 06:08:24 +0000 (06:08 +0000)
<tt> doesn't seem necessary and it's deprecated in HTML, nowadays.
In any case, dillo's CSS support seems to show it as fixed-width
even without <tt>.  Use the title= attribute to highlight that
it goes to the mail thread, too.

In the future, we'll probably link to something like "lei p2q"
(patch-to-query) to include OIDs in the search.

examples/cgit-commit-filter.lua

index 9614c94441e0149374f388e7bebc0df3662078d4..9857b3c9572a33a0a3e7723f96a0de5e753a6bba 100644 (file)
@@ -31,12 +31,13 @@ function filter_close()
                if u == nil then
                        html(buffer)
                else
-                       html('<a href="' .. u .. '?x=t&amp;q=')
+                       html("<a\ntitle='mail thread'\n")
+                       html('href="' .. u .. '?x=t&amp;q=')
                        s = string.gsub(buffer, '"', '""')
                        html_url_arg('"' .. s .. '"')
-                       html('"><tt>')
+                       html('">')
                        html_txt(buffer)
-                       html('</tt></a>')
+                       html('</a>')
                end
        else
                -- pass the body-through as-is