Sha256: 02f307274f5247839559ee252fc0a2a6a7dea6563adb70b6b4d7e875b0726ddc
Contents?: true
Size: 569 Bytes
Versions: 9
Compression:
Stored size: 569 Bytes
Contents
module ReverseAdoc 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
9 entries across 9 versions & 1 rubygems