From accbc901da85d9a6164a7745ba51a114fad722d6 Mon Sep 17 00:00:00 2001 From: pixel Date: Tue, 12 Jun 2007 16:38:50 +0000 Subject: Adding "empty" markup. --- lib/xmllib.lua | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/xmllib.lua b/lib/xmllib.lua index 007e96a..a6e97b2 100644 --- a/lib/xmllib.lua +++ b/lib/xmllib.lua @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: xmllib.lua,v 1.10 2007-06-12 07:41:55 pixel Exp $ */ +/* $Id: xmllib.lua,v 1.11 2007-06-12 16:38:50 pixel Exp $ */ ]]-- @@ -68,6 +68,13 @@ local function process_raw(xm, a) } end +local function process_empty(xm) + return { + istop = true, + type = "empty", + } +end + local function burrow(xm, t) local k, v @@ -172,10 +179,15 @@ local function render_raw(depth, v) return v.nodes[1] end +local function render_empty(depth, v) + return "" +end + local special_renders = { comment = render_comment, lf = render_lf, raw = render_raw, + empty = render_empty, } local function do_render_r(v, depth) @@ -231,6 +243,7 @@ function NewXmlMarkup() comment = process_comment, lf = process_lf, raw = process_raw, + empty = process_empty, tops = {}, render = do_render, doctype = '', -- cgit v1.2.3