Skip to content

Commit

Permalink
example plugin: add data-example-id only if it's been supplied. (#2…
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Sep 27, 2017
1 parent 1d6a6c2 commit 6dd3d91
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions _plugins/example.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def initialize(tag_name, markup, tokens)
#{markup} #{markup}
Valid syntax: example <lang> Valid syntax: example <lang> [id=foo]
eos eos
end end
end end
Expand All @@ -55,7 +55,7 @@ def render(context)
end end


def example(output) 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 end


def remove_holderjs(code) def remove_holderjs(code)
Expand Down

0 comments on commit 6dd3d91

Please sign in to comment.