diff options
| author | John MacFarlane <jgm@berkeley.edu> | 2014-11-23 07:08:57 -0800 | 
|---|---|---|
| committer | John MacFarlane <jgm@berkeley.edu> | 2014-11-23 07:08:57 -0800 | 
| commit | 1b6a4ce8ab921ddc98581abd395428e2cadd0c22 (patch) | |
| tree | 51cf1a80b7d48351ec1c17046e5cae3d86baa18d /commonmark.rb | |
| parent | 8ba087276c6cae9e1efde656ae973b4f714c88be (diff) | |
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.
Diffstat (limited to 'commonmark.rb')
| -rwxr-xr-x | commonmark.rb | 8 | 
1 files changed, 2 insertions, 6 deletions
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  | 
