Class: Quby::MarkdownParser
- Inherits:
-
Object
- Object
- Quby::MarkdownParser
- 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
- #html_safe ⇒ Object
-
#initialize(source) ⇒ MarkdownParser
constructor
A new instance of MarkdownParser.
- #to_html ⇒ Object
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_safe ⇒ Object
23 24 25 |
# File 'lib/quby/markdown_parser.rb', line 23 def html_safe to_html.html_safe end |
#to_html ⇒ Object
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 |