From 075d0e4607356fffe128a5e1e8098862068ccb5b Mon Sep 17 00:00:00 2001 From: StEve Young <2747745470@qq.com> Date: Wed, 27 Nov 2019 18:57:08 +0800 Subject: [PATCH] fix: prevent Prism calling highlightAll (#21) --- package.json | 2 +- src/highlight.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 97eccc1..d302015 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vuepress-plugin-demo-code", - "version": "0.4.1", + "version": "0.4.2", "description": "📝 Demo and code plugin for vuepress", "main": "src/index.js", "files": [ diff --git a/src/highlight.js b/src/highlight.js index 9b77bfb..4f2032a 100644 --- a/src/highlight.js +++ b/src/highlight.js @@ -1,9 +1,10 @@ -// https://github.com/vuejs/vuepress/blob/master/packages/@vuepress/markdown/lib/highlight.js - const prism = require('prismjs') const escapeHtml = require('escape-html') const loadLanguages = require('prismjs/components/index') +// prevent Prism calling `highlightAll` +prism.manual = true + // loadLanguages(['markup', 'css', 'javascript']) function wrap (code, lang) {