Module: Kitchen::Directions::BakeMathInParagraph

Defined in:
lib/kitchen/directions/bake_math_in_paragraph.rb

Overview

Wraps any math contained in a <p> tag with a <span> with class ‘os-math-in-para’

Class Method Summary collapse

Class Method Details

.v1(book:) ⇒ Object



8
9
10
11
12
# File 'lib/kitchen/directions/bake_math_in_paragraph.rb', line 8

def self.v1(book:)
  book.search('p m|math', '//p//math | //p//m').each do |math|
    math.wrap("<span class='os-math-in-para'>")
  end
end