Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load languages after setting global Prism. #124

Merged
merged 3 commits into from
Nov 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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