Sha256: 85892b89184bb2ef57b6ec36b8179568e6754292e9803037d8e294b66f5ddc59

Contents?: true

Size: 618 Bytes

Versions: 28

Compression:

Stored size: 618 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

28 entries across 28 versions & 1 rubygems

Version Path
stepmod-utils-0.3.34 lib/stepmod/utils/converters/em_express_description.rb
stepmod-utils-0.3.33 lib/stepmod/utils/converters/em_express_description.rb
stepmod-utils-0.3.32 lib/stepmod/utils/converters/em_express_description.rb
stepmod-utils-0.3.31 lib/stepmod/utils/converters/em_express_description.rb
stepmod-utils-0.3.30 lib/stepmod/utils/converters/em_express_description.rb
stepmod-utils-0.3.29 lib/stepmod/utils/converters/em_express_description.rb
stepmod-utils-0.3.28 lib/stepmod/utils/converters/em_express_description.rb
stepmod-utils-0.3.27 lib/stepmod/utils/converters/em_express_description.rb
stepmod-utils-0.3.26 lib/stepmod/utils/converters/em_express_description.rb
stepmod-utils-0.3.25 lib/stepmod/utils/converters/em_express_description.rb
stepmod-utils-0.3.24 lib/stepmod/utils/converters/em_express_description.rb
stepmod-utils-0.3.23 lib/stepmod/utils/converters/em_express_description.rb
stepmod-utils-0.3.22 lib/stepmod/utils/converters/em_express_description.rb
stepmod-utils-0.3.21 lib/stepmod/utils/converters/em_express_description.rb
stepmod-utils-0.3.20 lib/stepmod/utils/converters/em_express_description.rb
stepmod-utils-0.3.19 lib/stepmod/utils/converters/em_express_description.rb
stepmod-utils-0.3.18 lib/stepmod/utils/converters/em_express_description.rb
stepmod-utils-0.3.17 lib/stepmod/utils/converters/em_express_description.rb
stepmod-utils-0.3.16 lib/stepmod/utils/converters/em_express_description.rb
stepmod-utils-0.3.15 lib/stepmod/utils/converters/em_express_description.rb