Skip to content

Commit

Permalink
disabled a vue flag
Browse files Browse the repository at this point in the history
  • Loading branch information
deepansh96 committed May 9, 2024
1 parent 602fcb2 commit b961510
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/components/Editor/CodeHighlighter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,14 @@ export default {
Prism.highlightAllUnder(this.$refs.codeBlock);
},
/* eslint-disable vue/require-slots-as-functions */
beforeUpdate() {
const defaultSlot = this.$scopedSlots.default && this.$scopedSlots.default();
if (defaultSlot && typeof defaultSlot[0] === "string") {
const newText = defaultSlot[0].replace(/^[\r\n\s]*|[\r\n\s]*$/g, "");
if (typeof this.$slots.default[0] === "string") {
const newText = this.$slots.default[0].replace(/^[\r\n\s]*|[\r\n\s]*$/g, "");
this.$el.querySelector("code").textContent = newText;
Prism.highlightAllUnder(this.$refs.codeBlock);
}
// if (typeof this.$slots.default[0] === "string") {
// const newText = this.$slots.default[0].replace(/^[\r\n\s]*|[\r\n\s]*$/g, "");
// this.$el.querySelector("code").textContent = newText;
// Prism.highlightAllUnder(this.$refs.codeBlock);
// }
},
/* eslint-enable vue/require-slots-as-functions */
};
</script>

0 comments on commit b961510

Please sign in to comment.