aboutsummaryrefslogtreecommitdiff
path: root/_plugins/example.rb
diff options
context:
space:
mode:
authorXhmikosR <[email protected]>2017-09-27 13:08:03 +0300
committerGitHub <[email protected]>2017-09-27 13:08:03 +0300
commit6dd3d91768227a7ac03a63f8e47eacae99be8892 (patch)
treeed1776e062afb677080a673c53a23a59f7187371 /_plugins/example.rb
parent1d6a6c2abf4f4cdefae5741b68e78a38ef59f163 (diff)
downloadbootstrap-6dd3d91768227a7ac03a63f8e47eacae99be8892.tar.xz
bootstrap-6dd3d91768227a7ac03a63f8e47eacae99be8892.zip
example plugin: add `data-example-id` only if it's been supplied. (#24127)
Diffstat (limited to '_plugins/example.rb')
-rw-r--r--_plugins/example.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/_plugins/example.rb b/_plugins/example.rb
index 8a86a2202..913289720 100644
--- a/_plugins/example.rb
+++ b/_plugins/example.rb
@@ -34,7 +34,7 @@ Syntax Error in tag 'example' while parsing the following markup:
#{markup}
-Valid syntax: example <lang>
+Valid syntax: example <lang> [id=foo]
eos
end
end
@@ -55,7 +55,7 @@ eos
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)