Sha256: 5c1dd0b9d952cf6b49fd8db5269d9ba4db109c82e3fbe84386e068a0fae0cf98
Contents?: true
Size: 619 Bytes
Versions: 10
Compression:
Stored size: 619 Bytes
Contents
# frozen_string_literal: true module Stepmod module Utils module Converters class Em < ReverseAdoc::Converters::Base def convert(node, state = {}) content = treat_children(node, state.merge(already_italic: true)) if content.strip.empty? || state[:already_italic] content else "#{content[/^\s*/]}_#{content.strip}_#{content[/\s*$/]}" end end end ReverseAdoc::Converters.register :em, Em.new ReverseAdoc::Converters.register :i, Em.new ReverseAdoc::Converters.register :cite, Em.new end end end
Version data entries
10 entries across 10 versions & 1 rubygems