diff mod_xhtmlim/mod_xhtmlim.lua @ 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 276f7af8afd1
children 1f68287138e3
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);