Added the tabindex attribute to every <pre> tag.
authorsabadev <saba@sabadev.xyz>
Sat, 27 Mar 2021 15:14:20 +0000 (11:14 -0400)
committersabadev <dev@sabadev.xyz>
Tue, 13 Apr 2021 01:16:42 +0000 (21:16 -0400)
src/Sanitize.hs

index 734939f..b06c203 100644 (file)
@@ -8,4 +8,5 @@ sanitizeHtml :: Html () -> Html ()
 sanitizeHtml = toHtmlRaw . renderTree . transformTree sanitizeTree . parseTree . renderText
 
 sanitizeTree :: TagTree T.Text -> [TagTree T.Text]
-sanitizeTree = pure
+sanitizeTree (TagBranch "pre" attributes children) = [TagBranch "pre" (("tabindex", "0") : attributes) children]
+sanitizeTree x = [x]