1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-09 15:16:51 +02:00

Update code-examples.js (#38675)

This commit is contained in:
XhmikosR
2023-05-31 07:36:19 +03:00
committed by GitHub
parent 60098ac499
commit c5f46b020c

View File

@@ -31,7 +31,8 @@
// Wrap programmatically code blocks and add copy btn.
document.querySelectorAll('.highlight')
.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.previousElementSibling.append(element)
}