Class: MarkupParser
- Inherits:
-
Object
- Object
- MarkupParser
- Defined in:
- lib/Parsers/MarkupParser.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#isForJekyll ⇒ Object
Returns the value of attribute isForJekyll.
-
#paragraph ⇒ Object
Returns the value of attribute paragraph.
-
#usersPostURLs ⇒ Object
Returns the value of attribute usersPostURLs.
Instance Method Summary collapse
-
#initialize(paragraph, isForJekyll) ⇒ MarkupParser
constructor
A new instance of MarkupParser.
- #parse ⇒ Object
Constructor Details
#initialize(paragraph, isForJekyll) ⇒ MarkupParser
Returns a new instance of MarkupParser.
12 13 14 15 |
# File 'lib/Parsers/MarkupParser.rb', line 12 def initialize(paragraph, isForJekyll) @paragraph = paragraph @isForJekyll = isForJekyll end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
10 11 12 |
# File 'lib/Parsers/MarkupParser.rb', line 10 def body @body end |
#isForJekyll ⇒ Object
Returns the value of attribute isForJekyll.
10 11 12 |
# File 'lib/Parsers/MarkupParser.rb', line 10 def isForJekyll @isForJekyll end |
#paragraph ⇒ Object
Returns the value of attribute paragraph.
10 11 12 |
# File 'lib/Parsers/MarkupParser.rb', line 10 def paragraph @paragraph end |
#usersPostURLs ⇒ Object
Returns the value of attribute usersPostURLs.
10 11 12 |
# File 'lib/Parsers/MarkupParser.rb', line 10 def usersPostURLs @usersPostURLs end |
Instance Method Details
#parse ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/Parsers/MarkupParser.rb', line 17 def parse() result = paragraph.text if !paragraph.markups.nil? && paragraph.markups.length > 0 markupRender = MarkupStyleRender.new(paragraph, isForJekyll) markupRender.usersPostURLs = usersPostURLs begin result = markupRender.parse() rescue => e puts e.backtrace Helper.makeWarningText("Error occurred during render markup text, please help to open an issue on github.") end end result end |