class BookLab::SML::Rules::Paragraph

Public Class Methods

match?(node) click to toggle source
# File lib/booklab/sml/rules/paragraph.rb, line 5
def self.match?(node)
  tag_name(node) == "p"
end
to_html(node, opts = {}) click to toggle source
# File lib/booklab/sml/rules/paragraph.rb, line 9
def self.to_html(node, opts = {})
  renderer = opts[:renderer]
  children = renderer.children_to_html(node)
  attrs = attributes(node)

  style_attrs = style_for_attrs(attrs)

  %(<p#{style_attrs}>#{children}</p>)
end