Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion dashboard/src/components/docs/MarkdownBlock.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
elem.parentNode.classList.add('codeblock');
}

hljs.highlightBlock(elem);
hljs.highlightElement(elem);
});
}
},
Expand Down
10 changes: 10 additions & 0 deletions dashboard/src/directives/highlightjs.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import hljs from "highlight.js/lib/core";
import Vue from "vue";

Vue.directive("highlightjs", {
bind(el, binding) {
if (!el.classList.contains("plain")) {
hljs.highlightElement(el);
}
},
});
3 changes: 2 additions & 1 deletion dashboard/src/init-vue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ import Vue from "vue";

import VueHighlightJS from "@highlightjs/vue-plugin";
import hljs from "highlight.js/lib/core";
import hljsYaml from "highlight.js/lib/languages/yaml.js";
import hljsYaml from "highlight.js/lib/languages/yaml";
import "highlight.js/styles/base16/ocean.css";

import { router } from "./routes";
import { RootStore } from "./store";

import "./directives/highlightjs";
import "./directives/trim-indents";

import App from "./components/App.vue";
Expand Down