summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2015-01-11 15:07:44 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2015-01-11 15:07:44 -0800
commit009fe0141445275c495d0825a1d5c0a374fc9d90 (patch)
tree0ea8a9ed83bb0b1f2acfc85bbcb384ad3addd934
parentb811dd8facd3fe26da32b93d70ab92d3693fab5c (diff)
XML writer - implemented list attributes.
-rw-r--r--js/lib/xml.js24
1 files changed, 24 insertions, 0 deletions
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;
};