Sha256: 883d8c8c280a77977df9b83963d28132929a67356a58cf68138e115ea1f6cf3d

Contents?: true

Size: 451 Bytes

Versions: 10

Compression:

Stored size: 451 Bytes

Contents

module ReverseAsciidoctor
  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

10 entries across 10 versions & 2 rubygems

Version Path
reverse_adoc-0.2.8 lib/reverse_asciidoctor/converters/em.rb
reverse_adoc-0.2.7 lib/reverse_asciidoctor/converters/em.rb
reverse_adoc-0.2.6 lib/reverse_asciidoctor/converters/em.rb
reverse_adoc-0.2.5 lib/reverse_asciidoctor/converters/em.rb
reverse_adoc-0.2.4 lib/reverse_asciidoctor/converters/em.rb
reverse_adoc-0.2.3 lib/reverse_asciidoctor/converters/em.rb
reverse_asciidoctor-0.2.2 lib/reverse_asciidoctor/converters/em.rb
reverse_asciidoctor-0.2.1 lib/reverse_asciidoctor/converters/em.rb
reverse_asciidoctor-0.2.0 lib/reverse_asciidoctor/converters/em.rb
reverse_asciidoctor-0.1.0 lib/reverse_asciidoctor/converters/em.rb