fixed Syntax highlighting behaving wrongly for some languages
This commit is contained in:
parent
eed9ed554d
commit
d825ebdc4f
|
@ -99,12 +99,12 @@
|
|||
</template>
|
||||
<script>
|
||||
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;
|
||||
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
|
||||
if (navigator.clipboard) {
|
||||
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%);
|
||||
}
|
||||
|
||||
.prose pre, .prose code {
|
||||
@apply bg-neutral-200 text-black rounded-none border-current border-2;
|
||||
.prose div > pre, .prose > pre {
|
||||
@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