From 8f2f40679dc21e9d878aaed45fe9dc9d404073d0 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 15 Jan 2015 11:29:08 -0800 Subject: Added getType(), setType() to node.js. Use these instead of direct property access. This is the first step in a general move towards an API like the one libcmark has. This will allow us to have a stable API that is independent of details of the AST. --- js/lib/html.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'js/lib/html.js') diff --git a/js/lib/html.js b/js/lib/html.js index e361fe1..8e096dd 100644 --- a/js/lib/html.js +++ b/js/lib/html.js @@ -68,7 +68,7 @@ var renderNodes = function(block) { } } - switch (node.t) { + switch (node.getType()) { case 'Text': out(esc(node.literal)); break; @@ -134,7 +134,7 @@ var renderNodes = function(block) { case 'Paragraph': grandparent = node.parent.parent; if (grandparent !== null && - grandparent.t === 'List') { + grandparent.getType() === 'List') { if (grandparent.list_data.tight) { break; } @@ -225,7 +225,7 @@ var renderNodes = function(block) { break; default: - throw "Unknown node type " + node.t; + throw "Unknown node type " + node.getType(); } } -- cgit v1.2.3