mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-06 04:08:22 +01:00
example plugin: add data-example-id
only if it's been supplied. (#24127)
This commit is contained in:
parent
1d6a6c2abf
commit
6dd3d91768
@ -34,7 +34,7 @@ Syntax Error in tag 'example' while parsing the following markup:
|
|||||||
|
|
||||||
#{markup}
|
#{markup}
|
||||||
|
|
||||||
Valid syntax: example <lang>
|
Valid syntax: example <lang> [id=foo]
|
||||||
eos
|
eos
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -55,7 +55,7 @@ eos
|
|||||||
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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user