From f154f9cae5d9e6d0f2012e0040e87db96d6e2537 Mon Sep 17 00:00:00 2001 From: NGPixel Date: Sat, 23 Nov 2019 16:26:24 -0500 Subject: [PATCH] fix: markdown preview fails to load lang files for code blocks (#1162) --- client/components/editor/editor-markdown.vue | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/client/components/editor/editor-markdown.vue b/client/components/editor/editor-markdown.vue index 8284c4e2..3c07c69e 100644 --- a/client/components/editor/editor-markdown.vue +++ b/client/components/editor/editor-markdown.vue @@ -223,6 +223,17 @@ import Prism from 'prismjs' // Platform detection const CtrlKey = /Mac/.test(navigator.platform) ? 'Cmd' : 'Ctrl' +// Prism Config +Prism.plugins.autoloader.languages_path = '/js/prism/' +Prism.plugins.NormalizeWhitespace.setDefaults({ + 'remove-trailing': true, + 'remove-indent': true, + 'left-trim': true, + 'right-trim': true, + 'remove-initial-line-feed': true, + 'tabs-to-spaces': 2 +}) + // Markdown Instance const md = new MarkdownIt({ html: true,