Class: MarkdownUI::CustomTag
- Inherits:
-
Object
- Object
- MarkdownUI::CustomTag
- Defined in:
- lib/markdown-ui/tag/custom_tag.rb
Instance Method Summary collapse
-
#initialize(tag, content, klass = nil) ⇒ CustomTag
constructor
A new instance of CustomTag.
- #render ⇒ Object
Constructor Details
#initialize(tag, content, klass = nil) ⇒ CustomTag
Returns a new instance of CustomTag.
5 6 7 8 9 |
# File 'lib/markdown-ui/tag/custom_tag.rb', line 5 def initialize(tag, content, klass = nil) @tag = tag @klass = klass @content = content end |
Instance Method Details
#render ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/markdown-ui/tag/custom_tag.rb', line 11 def render klass = MarkdownUI::KlassUtil.new("#{@klass}").klass tag = @tag.downcase.strip content = MarkdownUI::Content::Parser.new(@content).parse output = [] output << "<#{tag}" output << "#{klass}>" output << content output << "</#{tag}>" output.join(' ') end |