Sha256: 5865729c0aabf858b0f97f5799683124dda23cbf12507231a0b563e1801221ce

Contents?: true

Size: 444 Bytes

Versions: 9

Compression:

Stored size: 444 Bytes

Contents

module ReverseAdoc
  module Converters
    class Em < 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

    register :em, Em.new
    register :i,  Em.new
    register :cite,  Em.new
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
reverse_adoc-0.3.7 lib/reverse_adoc/converters/em.rb
reverse_adoc-0.3.6 lib/reverse_adoc/converters/em.rb
reverse_adoc-0.3.5 lib/reverse_adoc/converters/em.rb
reverse_adoc-0.3.4 lib/reverse_adoc/converters/em.rb
reverse_adoc-0.3.3 lib/reverse_adoc/converters/em.rb
reverse_adoc-0.3.1 lib/reverse_adoc/converters/em.rb
reverse_adoc-0.3.0 lib/reverse_adoc/converters/em.rb
reverse_adoc-0.2.10 lib/reverse_adoc/converters/em.rb
reverse_adoc-0.2.9 lib/reverse_adoc/converters/em.rb