Permalink
Browse files

example plugin: add `data-example-id` only if it's been supplied. (#2…

  • Loading branch information...
XhmikosR committed Sep 27, 2017
1 parent 1d6a6c2 commit 6dd3d91768227a7ac03a63f8e47eacae99be8892
Showing with 2 additions and 2 deletions.
  1. +2 −2 _plugins/example.rb
View
@@ -34,7 +34,7 @@ def initialize(tag_name, markup, tokens)
#{markup}
Valid syntax: example <lang>
Valid syntax: example <lang> [id=foo]
eos
end
end
@@ -55,7 +55,7 @@ def render(context)
end
def example(output)
"<div class=\"bd-example\" data-example-id=\"#{@options[:id]}\">\n#{output}\n</div>"
"<div class=\"bd-example\"" + (@options[:id] ? " data-example-id=\"#{@options[:id]}\"" : "") + ">\n#{output}\n</div>"
end
def remove_holderjs(code)

0 comments on commit 6dd3d91

Please sign in to comment.