changeset 3404:6444fb5dbb51

mod_xhtmlim: Turn unknown elements into <span> In HTML, you're supposed to replace unknown tags with their content. The :maptags API can't replace tags with text, but replacing with <span> should close enough.
author Kim Alvefur <zash@zash.se>
date Thu, 13 Dec 2018 14:32:17 +0100
parents 823027110e29
children bd71c97de1d0
files mod_xhtmlim/mod_xhtmlim.lua
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mod_xhtmlim/mod_xhtmlim.lua	Thu Dec 13 10:35:26 2018 +0000
+++ b/mod_xhtmlim/mod_xhtmlim.lua	Thu Dec 13 14:32:17 2018 +0100
@@ -87,8 +87,8 @@
 				end
 			end
 		else
-			-- Can't happen with the above assert.
-			return nil;
+			tag.name = "span"
+			tag.attr = { xmlns = "http://www.w3.org/1999/xhtml" }
 		end
 		-- Check child tags
 		tag:maptags(sanitize_xhtml);