Sha256: f0c4234466069cd26dc77037aa4ba91cd781c1ba6719a25915cd99641b3cb732

Contents?: true

Size: 514 Bytes

Versions: 2

Compression:

Stored size: 514 Bytes

Contents

module ReverseAdoc
  module Converters
    class Mark < Base
      def to_coradoc(node, state = {})
        content = treat_children(node, state.merge(already_strong: true))

        if content.strip.empty? || state[:already_strong]
          return content
        end

        Coradoc::Element::Inline::Highlight.new(content, constrained?(node))
      end

      def convert(node, state = {})
        Coradoc::Generator.gen_adoc(to_coradoc(node, state))
      end
    end

    register :mark, Mark.new
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
reverse_adoc-1.0.1 lib/reverse_adoc/converters/mark.rb
reverse_adoc-1.0.0 lib/reverse_adoc/converters/mark.rb