From 88817709d3a64453ffd0b4e9f9a03d44aaa9df16 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Wed, 28 Jun 2023 16:15:34 +0100 Subject: [PATCH] tools/2xep.lua: Fix elements having unsupported attributes The XEP DTD only supports a single attribute for , the 'caption' attribute. I don't know if/how it's possible to attach a caption in markdown, so I'm leaving that as unsupported. That means no attributes are supported, and therefore I've removed them. Usage of ```xml is common, so I've also added code to handle those and convert them to example blocks. --- tools/2xep.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/2xep.lua b/tools/2xep.lua index cdf8b8fd..83a06b3f 100644 --- a/tools/2xep.lua +++ b/tools/2xep.lua @@ -286,10 +286,10 @@ local function has(haystack, needle) --> boolean end function CodeBlock(s, attr) - if attr and attr.class and has(attr.class, "example") then + if attr and attr.class and (has(attr.class, "example") or has(attr.class, "xml")) then return "" else - return "" + return "" end end