diff options
author | John MacFarlane <jgm@berkeley.edu> | 2014-11-22 21:32:21 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2014-11-22 21:32:21 -0800 |
commit | a71423f6ee1b77d9f79d42599ea00b4ca99f5da0 (patch) | |
tree | b6007b211ffbedf996a7416dbbc26f6d33006913 /commonmark.rb | |
parent | acac9428faa1c3193fb44b3fb0e2dd3cbdaa4ac9 (diff) |
Remove distinction btw atx and setext header in AST.
Now we just have 'header' -- Setext and ATX are just two ways
of forming these; it's not a semantic difference that should remain
in the AST.
Diffstat (limited to 'commonmark.rb')
-rwxr-xr-x | commonmark.rb | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/commonmark.rb b/commonmark.rb index 0140c1b..94744dd 100755 --- a/commonmark.rb +++ b/commonmark.rb @@ -11,7 +11,7 @@ module CMark typedef :pointer, :node enum :node_type, [:document, :blockquote, :list, :list_item, :fenced_code, :indented_code, :html, :paragraph, - :atx_header, :setext_header, :hrule, :reference_def, + :header, :hrule, :reference_def, :str, :softbreak, :linebreak, :code, :inline_html, :emph, :strong, :link, :image] enum :list_type, [:no_list, :bullet_list, :ordered_list] @@ -55,7 +55,7 @@ class Node b = CMark::cmark_node_next(b) end @string_content = CMark::cmark_node_get_string_content(pointer) - if @type == :atx_header || @type == :setext_header + if @type == :header @header_level = CMark::cmark_node_get_header_level(pointer) end if @type == :list @@ -195,14 +195,6 @@ class Renderer self.code_block(node) end - def setext_header(node) - self.header(node) - end - - def atx_header(node) - self.header(node) - end - def reference_def(node) end @@ -375,7 +367,7 @@ end # Capitalize strings in headers doc.walk do |node| - if node.type == :setext_header or node.type == :atx_header + if node.type == :header node.walk do |subnode| if subnode.type == :str subnode.string_content = subnode.string_content.upcase |