From 009fe0141445275c495d0825a1d5c0a374fc9d90 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 11 Jan 2015 15:07:44 -0800 Subject: XML writer - implemented list attributes. --- js/lib/xml.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'js') diff --git a/js/lib/xml.js b/js/lib/xml.js index e187e89..cb59d7b 100644 --- a/js/lib/xml.js +++ b/js/lib/xml.js @@ -71,6 +71,29 @@ var renderNodes = function(block) { tagname = node.t.toLowerCase(); attrs = []; + + if (node.list_data) { + var data = node.list_data; + if (data.type) { + attrs.push(['type', data.type.toLowerCase()]); + } + if (data.start) { + attrs.push(['start', String(data.start)]); + } + if (data.tight) { + attrs.push(['tight', (data.tight ? 'true' : 'false')]); + } + if (data.delimiter) { + var delimword = ''; + if (data.delimiter === '.') { + delimword = 'period'; + } else { + delimword = 'paren'; + } + attrs.push(['delimiter', delimword]); + } + } + if (options.sourcepos) { var pos = node.sourcepos; if (pos) { @@ -100,6 +123,7 @@ var renderNodes = function(block) { } if (options.time) { console.timeEnd("rendering"); } + buffer += '\n'; return buffer; }; -- cgit v1.2.3