class ReverseAsciidoctor::Converters::H

Public Instance Methods

convert(node, state = {}) click to toggle source
# File lib/reverse_asciidoctor/converters/h.rb, line 4
def convert(node, state = {})
  id = node['id']
  anchor = id ? "[[#{id}]]\n" : ""
  prefix = '=' * (node.name[/\d/].to_i + 1)
  ["\n", anchor, prefix, ' ', treat_children(node, state), "\n"].join
end