class ReverseMarkdown::Converters::P

Public Instance Methods

convert(node, state = {}) click to toggle source
# File lib/github_to_canvas_quiz/reverse_markdown/converters/p.rb, line 8
def convert(node, state = {})
  content = treat_children(node, state)
  "\n\n#{wrap(content).strip}\n\n"
end

Private Instance Methods

wrap(text, width = 80) click to toggle source
# File lib/github_to_canvas_quiz/reverse_markdown/converters/p.rb, line 15
def wrap(text, width = 80)
  text.gsub(/(.{1,#{width}})(\s+|\Z)/, "\\1\n")
end