Sha256: bd53a8bc86a6078610d5c10ba3e1f02aa209ccf6bb6e5093290ed2c7b201d60d

Contents?: true

Size: 724 Bytes

Versions: 42

Compression:

Stored size: 724 Bytes

Contents

match("**") do |elements|
  have_preformatted_in_parent = Proc.new do |element|
    if element.nil?
      false
    elsif element.is_a?(PreformattedBlock)
      true
    else
      have_preformatted_in_parent.call(element.parent)
    end
  end

  have_preformatted_in_children = Proc.new do |element|
    if element.nil?
      false
    elsif element.is_a?(PreformattedBlock)
      true
    elsif element.respond_to?(:elements)
      element.elements.any? {|child| have_preformatted_in_children.call(child)}
    else
      false
    end
  end

  elements.each do |element|
    next if have_preformatted_in_parent.call(element)
    next if have_preformatted_in_children.call(element)
    element.substitute_newline
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
rabbit-3.0.3 lib/rabbit/theme/newline-in-slides/newline-in-slides.rb
rabbit-3.0.2 lib/rabbit/theme/newline-in-slides/newline-in-slides.rb
rabbit-3.0.1 lib/rabbit/theme/newline-in-slides/newline-in-slides.rb
rabbit-3.0.0 lib/rabbit/theme/newline-in-slides/newline-in-slides.rb
rabbit-2.2.1 lib/rabbit/theme/newline-in-slides/newline-in-slides.rb
rabbit-2.2.0 lib/rabbit/theme/newline-in-slides/newline-in-slides.rb
rabbit-2.1.9 lib/rabbit/theme/newline-in-slides/newline-in-slides.rb
rabbit-2.1.8 lib/rabbit/theme/newline-in-slides/newline-in-slides.rb
rabbit-2.1.7 lib/rabbit/theme/newline-in-slides/newline-in-slides.rb
rabbit-2.1.6 lib/rabbit/theme/newline-in-slides/newline-in-slides.rb
rabbit-2.1.5 lib/rabbit/theme/newline-in-slides/newline-in-slides.rb
rabbit-2.1.4 lib/rabbit/theme/newline-in-slides/newline-in-slides.rb
rabbit-2.1.3 lib/rabbit/theme/newline-in-slides/newline-in-slides.rb
rabbit-2.1.2 lib/rabbit/theme/newline-in-slides/newline-in-slides.rb
rabbit-2.1.1 lib/rabbit/theme/newline-in-slides/newline-in-slides.rb
rabbit-2.1.0 lib/rabbit/theme/newline-in-slides/newline-in-slides.rb
rabbit-2.0.9 lib/rabbit/theme/newline-in-slides/newline-in-slides.rb
rabbit-2.0.8 lib/rabbit/theme/newline-in-slides/newline-in-slides.rb
rabbit-2.0.7 lib/rabbit/theme/newline-in-slides/newline-in-slides.rb
rabbit-2.0.6 lib/rabbit/theme/newline-in-slides/newline-in-slides.rb