From 1b6a4ce8ab921ddc98581abd395428e2cadd0c22 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 23 Nov 2014 07:08:57 -0800 Subject: Do not distinguish btw fenced and indented code in AST. Use a single CMARK_NODE_CODE_BLOCK tag for both. Distinguish them when needed for parsing by looking at the fence_length attribute, which is 0 for indented blocks. --- commonmark.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'commonmark.rb') diff --git a/commonmark.rb b/commonmark.rb index 94744dd..dead84c 100755 --- a/commonmark.rb +++ b/commonmark.rb @@ -10,7 +10,7 @@ module CMark ffi_lib ['libcmark', 'cmark'] typedef :pointer, :node enum :node_type, [:document, :blockquote, :list, :list_item, - :fenced_code, :indented_code, :html, :paragraph, + :code_block, :html, :paragraph, :header, :hrule, :reference_def, :str, :softbreak, :linebreak, :code, :inline_html, :emph, :strong, :link, :image] @@ -187,11 +187,7 @@ class Renderer self.out(node.children) end - def indented_code(node) - self.code_block(node) - end - - def fenced_code(node) + def code_block(node) self.code_block(node) end -- cgit v1.2.3