Class: Jekyll::Tags::UseSvg
- Inherits:
-
Liquid::Tag
- Object
- Liquid::Tag
- Jekyll::Tags::UseSvg
- Defined in:
- lib/esvg/jekyll_hooks.rb
Instance Method Summary collapse
-
#initialize(tag_name, markup, tokens) ⇒ UseSvg
constructor
A new instance of UseSvg.
- #render(context) ⇒ Object
Constructor Details
#initialize(tag_name, markup, tokens) ⇒ UseSvg
Returns a new instance of UseSvg.
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/esvg/jekyll_hooks.rb', line 48 def initialize(tag_name, markup, tokens) super markup.sub!(/(\S+) /) do @name = $1.gsub(/[",']/, '') '' end @options = markup.strip.split(/,\s*/).join("\n") if @options.empty? @options = {} else @options = Esvg.deep_symbolize_hash_keys(YAML.load(@options)) unless @options.empty? end end |