Class: Quby::MarkdownParser

Inherits:
Object
  • Object
show all
Includes:
TextTransformation
Defined in:
lib/quby/markdown_parser.rb

Constant Summary collapse

EXTENTIONS =
{
  no_intra_emphasis: true
}.freeze

Constants included from TextTransformation

TextTransformation::LINK_URL_REGEX, TextTransformation::TEXT_VAR_REGEX

Instance Method Summary collapse

Methods included from TextTransformation

#link_html, #textvar_html, #transform_special_text

Constructor Details

#initialize(source) ⇒ MarkdownParser

Returns a new instance of MarkdownParser.



14
15
16
# File 'lib/quby/markdown_parser.rb', line 14

def initialize(source)
  @source = source || ""
end

Instance Method Details

#html_safeObject



23
24
25
# File 'lib/quby/markdown_parser.rb', line 23

def html_safe
  to_html.html_safe
end

#to_htmlObject



18
19
20
21
# File 'lib/quby/markdown_parser.rb', line 18

def to_html
  rc_html = parser.render(@source).strip
  transform_special_text(rc_html)
end