mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-10 15:44:51 +02:00
Update code-examples.js (#38675)
This commit is contained in:
@@ -31,7 +31,8 @@
|
|||||||
// Wrap programmatically code blocks and add copy btn.
|
// Wrap programmatically code blocks and add copy btn.
|
||||||
document.querySelectorAll('.highlight')
|
document.querySelectorAll('.highlight')
|
||||||
.forEach(element => {
|
.forEach(element => {
|
||||||
if (!element.closest('.bd-example-snippet')) { // Ignore examples made be shortcode
|
// Ignore examples made by shortcode
|
||||||
|
if (!element.closest('.bd-example-snippet')) {
|
||||||
element.insertAdjacentHTML('beforebegin', btnHtml)
|
element.insertAdjacentHTML('beforebegin', btnHtml)
|
||||||
element.previousElementSibling.append(element)
|
element.previousElementSibling.append(element)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user