fixed Syntax highlighting behaving wrongly for some languages
This commit is contained in:
parent
eed9ed554d
commit
d825ebdc4f
|
@ -99,12 +99,12 @@
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
async function copyCode(event) {
|
async function copyCode(event) {
|
||||||
const container = event.srcElement.closest("div").querySelector("code, pre");
|
const container = event.srcElement.closest("pre, div").querySelector("code, pre");
|
||||||
let text = container.innerText;
|
let text = container.innerText;
|
||||||
await navigator.clipboard.writeText(text);
|
await navigator.clipboard.writeText(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
document.querySelectorAll(".prose pre, .prose code").forEach((block) => {
|
document.querySelectorAll(".prose div > pre, .prose pre > code").forEach((block) => {
|
||||||
// only add a button if browser supports Clipboard API
|
// only add a button if browser supports Clipboard API
|
||||||
if (navigator.clipboard) {
|
if (navigator.clipboard) {
|
||||||
block.parentElement.classList.add("relative");
|
block.parentElement.classList.add("relative");
|
||||||
|
|
|
@ -45,7 +45,10 @@ @layer components {
|
||||||
mask-image: linear-gradient(black, black 80%, rgba(0, 0, 0, 0.5) 85%, transparent 100%);
|
mask-image: linear-gradient(black, black 80%, rgba(0, 0, 0, 0.5) 85%, transparent 100%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.prose pre, .prose code {
|
.prose div > pre, .prose > pre {
|
||||||
@apply bg-neutral-200 text-black rounded-none border-current border-2;
|
@apply bg-inherit text-inherit rounded-none;
|
||||||
|
}
|
||||||
|
.prose pre:has(code) {
|
||||||
|
@apply border-2 border-current;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
2
Wave/wwwroot/css/main.min.css
vendored
2
Wave/wwwroot/css/main.min.css
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue