Fixed inconsistency of code block sequence number in community edition and Insiders

This commit is contained in:
squidfunk 2023-03-19 17:30:34 +01:00
parent c3ba161233
commit 5f02d02dc4
7 changed files with 11 additions and 11 deletions

View File

@ -175,7 +175,7 @@ You can cancel your sponsorship anytime.[^5]
[![Datadog]](https://datadoghq.com/){ target=_blank title="Datadog" }
[![Zenoss]](https://zenoss.com/){ target=_blank title="Zenoss" }
[![Elli]](https://www.elli.eco/en/home){ target=_blank title="Elli - A Brand of the Volkswagen Group" }
[![Posit]](docs.posit.co){ target=_blank title="Posit" }
[![Posit]](https://docs.posit.co){ target=_blank title="Posit" }
[![n8n]](https://n8n.io){ target=_blank title="n8n" }
[![Dogado]](https://www.dogado.de){ target=_blank title="Dogado" }
[![World Wide Technology]](https://wwt.com){ target=_blank title="World Wide Technology" }

View File

@ -40,7 +40,7 @@ Click on a tile to change the color scheme:
button.addEventListener("click", function() {
var attr = this.getAttribute("data-md-color-scheme")
document.body.setAttribute("data-md-color-scheme", attr)
var name = document.querySelector("#__code_1 code span.l")
var name = document.querySelector("#__code_0 code span.l")
name.textContent = attr
})
})
@ -95,7 +95,7 @@ Click on a tile to change the primary color:
button.addEventListener("click", function() {
var attr = this.getAttribute("data-md-color-primary")
document.body.setAttribute("data-md-color-primary", attr)
var name = document.querySelector("#__code_2 code span.l")
var name = document.querySelector("#__code_1 code span.l")
name.textContent = attr.replace("-", " ")
})
})
@ -152,7 +152,7 @@ Click on a tile to change the accent color:
button.addEventListener("click", function() {
var attr = this.getAttribute("data-md-color-accent")
document.body.setAttribute("data-md-color-accent", attr)
var name = document.querySelector("#__code_3 code span.l")
var name = document.querySelector("#__code_2 code span.l")
name.textContent = attr.replace("-", " ")
})
})

View File

@ -126,7 +126,7 @@ Click on a tile to change the directionality:
button.addEventListener("click", function() {
var attr = this.getAttribute("data-md-dir")
document.body.dir = attr
var name = document.querySelector("#__code_3 code span.l")
var name = document.querySelector("#__code_2 code span.l")
name.textContent = attr
})
})

View File

@ -240,7 +240,7 @@
</script>
{% endblock %}
{% block scripts %}
<script src="{{ 'assets/javascripts/bundle.8bbcded3.min.js' | url }}"></script>
<script src="{{ 'assets/javascripts/bundle.20c9977b.min.js' | url }}"></script>
{% for path in config.extra_javascript %}
<script src="{{ path | url }}"></script>
{% endfor %}

View File

@ -177,7 +177,7 @@ export function mountCodeBlock(
feature("content.code.copy") && !el.closest(".no-copy")
)) {
const parent = el.closest("pre")!
parent.id = `__code_${++sequence}`
parent.id = `__code_${sequence++}`
parent.insertBefore(
renderClipboardButton(parent.id),
el