Sha256: 4751c93d74ae5f905657dd56e89547d69218b798fcf61d852087bbe65445e4f5
Contents?: true
Size: 576 Bytes
Versions: 10
Compression:
Stored size: 576 Bytes
Contents
module ReverseAsciidoctor module Converters class Li < Base def convert(node, state = {}) id = node['id'] anchor = id ? "[[#{id}]]" : "" content = treat_children(node, state) prefix = prefix_for(node, state) "#{prefix} #{anchor}#{content.chomp}\n" end def prefix_for(node, state) length = state.fetch(:ol_count, 0) if node.parent.name == 'ol' "." * [length, 0].max else "*" * [length, 0].max end end end register :li, Li.new end end
Version data entries
10 entries across 10 versions & 2 rubygems