Class: Quby::Compiler::MarkdownParser

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

Constant Summary collapse

EXTENTIONS =
{
  no_intra_emphasis: true
}.freeze

Constants included from Services::TextTransformation

Services::TextTransformation::LINK_URL_REGEX, Services::TextTransformation::TEXT_VAR_REGEX

Instance Method Summary collapse

Methods included from Services::TextTransformation

#link_html, #textvar_html, #transform_special_text

Constructor Details

#initialize(source) ⇒ MarkdownParser

Returns a new instance of MarkdownParser.



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

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

Instance Method Details

#html_safeObject



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

def html_safe
  to_html.html_safe
end

#to_htmlObject



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

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