Skip to content

Commit 7a3d8bc

Browse files
committed
respect code-lang=plain
1 parent c63d287 commit 7a3d8bc

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

dashboard/src/components/docs/CodeBlock.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<pre class="codeblock" v-highlightjs><code :class="codeLang" v-trim-indents="trim"><slot></slot></code></pre>
2+
<pre class="codeblock"><code :class="codeLang" v-trim-indents="trim" v-highlightjs><slot></slot></code></pre>
33
</template>
44

55
<script>

dashboard/src/directives/highlightjs.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import hljs from "highlight.js/lib/core";
33

44
Vue.directive("highlightjs", {
55
bind(el, binding) {
6-
hljs.highlightElement(el);
6+
if(!el.classList.contains("plain")) {
7+
hljs.highlightElement(el);
8+
};
79
},
810
});

0 commit comments

Comments
 (0)