Skip to content

Commit

Permalink
Fix Prism import order (fixes FormidableLabs#526)
Browse files Browse the repository at this point in the history
  • Loading branch information
rainboxx committed May 17, 2018
1 parent 6da0358 commit 4823e8b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 13 additions & 0 deletions src/components/code-pane.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,17 @@ describe('<CodePane />', () => {
const wrapper = mount(<CodePane lang="jsx" source={source} />, { 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(<CodePane lang="java" source={source} />, { context });
}).not.toThrow();
});
});
2 changes: 0 additions & 2 deletions src/utils/prism-import.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 4823e8b

Please sign in to comment.