diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-01-15 11:29:08 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-01-15 11:29:08 -0800 |
commit | 8f2f40679dc21e9d878aaed45fe9dc9d404073d0 (patch) | |
tree | c894fb248febd9b87e43bbd9cf6b988e89248744 /js/lib/html.js | |
parent | a7b27f8ee13f54979d71d961457fc187c9626387 (diff) |
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.
Diffstat (limited to 'js/lib/html.js')
-rw-r--r-- | js/lib/html.js | 6 |
1 files changed, 3 insertions, 3 deletions
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(); } } |