File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed
assets/components/Website/Docs Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -10,12 +10,27 @@ import { highlightCode } from "../../../helpers/highlightCode";
1010import { TransitionRoot } from " @headlessui/vue" ;
1111import { ClipboardDocumentIcon } from " @heroicons/vue/24/solid" ;
1212
13- const language = ref (" php" );
1413const formattedCode = ref (" " );
1514const code = ref (slots .default ()[0 ].children );
1615
16+ const props = defineProps ({
17+ lang: {
18+ type: String ,
19+ default: " php" ,
20+ },
21+ noHighlight: {
22+ type: Boolean ,
23+ default: false ,
24+ },
25+ });
26+
1727const highlight = () => {
18- formattedCode .value = highlightCode (code .value , language .value );
28+ if (props .noHighlight === true ) {
29+ formattedCode .value = code .value ;
30+ return ;
31+ }
32+
33+ formattedCode .value = highlightCode (code .value , props .lang );
1934};
2035
2136onMounted (() => {
@@ -66,7 +81,7 @@ const clipboardAvailable = computed(() => {
6681 <span class =" absolute right-4 top-4 font-mono text-[10px] text-pink-600" >Copied!</span >
6782 </TransitionRoot >
6883 <div class =" mb-4 overflow-y-scroll rounded-md border border-gray-600 bg-gray-900 p-4" >
69- <pre ><code class =" block text-xs " :class =" language " v-html =" formattedCode" ></code ></pre >
84+ <pre ><code class =" block text-xs" :class =" lang " v-html =" formattedCode" ></code ></pre >
7085 </div >
7186 </div >
7287</template >
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ echo $count / $numberCount;</pre
6464 </ul >
6565
6666 <p >Our problem file might look like the following.</p >
67- <CodeBlock lang =" md" >
67+ <CodeBlock lang =" md" no-highlight >
6868 <pre >
6969Write a program that accepts one or more numbers as command-line arguments and prints the mean average of those numbers to the console (stdout).
7070
You can’t perform that action at this time.
0 commit comments