From 4823e8b651a10b5ca0d88a718c705b80beff8918 Mon Sep 17 00:00:00 2001 From: Matthias Dietrich Date: Thu, 17 May 2018 14:40:56 +0200 Subject: [PATCH] Fix Prism import order (fixes #526) --- src/components/code-pane.test.js | 13 +++++++++++++ src/utils/prism-import.js | 2 -- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/components/code-pane.test.js b/src/components/code-pane.test.js index 693d47d9b..59fb2c4ce 100644 --- a/src/components/code-pane.test.js +++ b/src/components/code-pane.test.js @@ -21,4 +21,17 @@ describe('', () => { const wrapper = mount(, { context }); expect(wrapper).toMatchSnapshot(); }); + + test('should handle languages', () => { + const context = { + styles: { + components: { codePane: {}, syntax: {} }, + prism: { light: 'light;', dark: 'dark;' } + } + }; + const source = `import org.apache.commons.lang3.StringUtils;`; + expect(() => { + mount(, { context }); + }).not.toThrow(); + }); }); diff --git a/src/utils/prism-import.js b/src/utils/prism-import.js index 8b47f456d..d62b1163e 100644 --- a/src/utils/prism-import.js +++ b/src/utils/prism-import.js @@ -1,5 +1,3 @@ -import 'prismjs/components/prism-core'; - // NOTE: This includes a "slim" list of some components of prism, but not all // For more, see: https://github.com/PrismJS/prism/blob/1fd690dd8a652dee375acb78b6034c3fc2db687c/components.js // and: https://github.com/PrismJS/prism/tree/gh-pages/components