Skip to content

Commit

Permalink
respect code-lang=plain
Browse files Browse the repository at this point in the history
  • Loading branch information
rubyowo committed Jun 2, 2024
1 parent 6821116 commit bb02fd0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dashboard/src/components/docs/CodeBlock.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<pre class="codeblock" v-highlightjs><code :class="codeLang" v-trim-indents="trim"><slot></slot></code></pre>
<pre class="codeblock"><code :class="codeLang" v-trim-indents="trim" v-highlightjs><slot></slot></code></pre>
</template>

<script>
Expand Down
4 changes: 3 additions & 1 deletion dashboard/src/directives/highlightjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import hljs from "highlight.js/lib/core";

Vue.directive("highlightjs", {
bind(el, binding) {
hljs.highlightElement(el);
if(!el.classList.contains("plain")) {
hljs.highlightElement(el);
};
},
});

0 comments on commit bb02fd0

Please sign in to comment.