Skip to content

Commit

Permalink
Load languages after setting global Prism. (#124)
Browse files Browse the repository at this point in the history
Load languages after setting global Prism.
  • Loading branch information
ghengeveld authored Nov 28, 2019
2 parents 45d28b0 + 14794dc commit 5e13f32
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 10 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
# v2.0.1 (Thu Nov 28 2019)

#### 🐛 Bug Fix

- Load languages after setting global Prism. [#124](https://github.com/storybookjs/design-system/pull/124) ([@ghengeveld](https://github.com/ghengeveld))

#### ⚠️ Pushed to master

- Update changelog ([@ghengeveld](https://github.com/ghengeveld))

#### Authors: 1

- Gert Hengeveld ([@ghengeveld](https://github.com/ghengeveld))

---

# v2.0.0 (Thu Nov 28 2019)

#### 💥 Breaking Change
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/design-system",
"version": "2.0.0",
"version": "2.0.1",
"description": "Storybook design system",
"repository": {
"type": "git",
Expand Down
19 changes: 10 additions & 9 deletions src/components/Highlight.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
/* eslint-disable react/no-danger */
/* eslint-disable react/no-danger, global-require */
import React from 'react';
import ReactDOM from 'react-dom';
import styled from 'styled-components';
import Prism from 'prismjs';
import PropTypes from 'prop-types';
import { color } from './shared/styles';

import 'prismjs/components/prism-bash';
import 'prismjs/components/prism-javascript';
import 'prismjs/components/prism-typescript';
import 'prismjs/components/prism-json';
import 'prismjs/components/prism-css';
import 'prismjs/components/prism-yaml';

global.Prism = Prism;
if (typeof document !== 'undefined') {
global.Prism = Prism;
require('prismjs/components/prism-bash');
require('prismjs/components/prism-javascript');
require('prismjs/components/prism-typescript');
require('prismjs/components/prism-json');
require('prismjs/components/prism-css');
require('prismjs/components/prism-yaml');
}

const languages = ['bash', 'javascript', 'typescript', 'json', 'css', 'yaml'];

Expand Down

0 comments on commit 5e13f32

Please sign in to comment.