Class: Blogit::Parsers::MarkdownParser
- Inherits:
-
Object
- Object
- Blogit::Parsers::MarkdownParser
- Defined in:
- lib/blogit/parsers/markdown_parser.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
A String containing the content to be parsed.
Instance Method Summary collapse
-
#initialize(content) ⇒ MarkdownParser
constructor
A new instance of MarkdownParser.
-
#parsed ⇒ Object
The parsed content.
Constructor Details
#initialize(content) ⇒ MarkdownParser
Returns a new instance of MarkdownParser.
9 10 11 |
# File 'lib/blogit/parsers/markdown_parser.rb', line 9 def initialize(content) @content = content end |
Instance Attribute Details
#content ⇒ Object (readonly)
A String containing the content to be parsed
7 8 9 |
# File 'lib/blogit/parsers/markdown_parser.rb', line 7 def content @content end |
Instance Method Details
#parsed ⇒ Object
The parsed content
Returns an HTML safe String
16 17 18 19 |
# File 'lib/blogit/parsers/markdown_parser.rb', line 16 def parsed ensure_pygments_is_installed if Blogit::configuration.highlight_code_syntax markdown.render(content).html_safe end |