diff options
author | Samy Pesse <samypesse@gmail.com> | 2016-10-12 15:47:29 +0200 |
---|---|---|
committer | Samy Pesse <samypesse@gmail.com> | 2016-10-12 15:47:29 +0200 |
commit | 961b9d7031347c2c108b22c9c4cf85ce3e0c63d0 (patch) | |
tree | 770e0219c17f4875df6a7549cf7afcb356fcfb99 | |
parent | 5b0622014afe35a7f1eda9a47e2f94710304f8c6 (diff) | |
download | gitbook-961b9d7031347c2c108b22c9c4cf85ce3e0c63d0.zip gitbook-961b9d7031347c2c108b22c9c4cf85ce3e0c63d0.tar.gz gitbook-961b9d7031347c2c108b22c9c4cf85ce3e0c63d0.tar.bz2 |
Fix error for code blocks without language
-rw-r--r-- | package.json | 2 | ||||
-rw-r--r-- | packages/gitbook-core/src/shapes/File.js | 3 | ||||
-rw-r--r-- | packages/gitbook-plugin-highlight/src/CodeBlock.js | 2 | ||||
-rw-r--r-- | packages/gitbook/src/browser/__tests__/render.js | 4 |
4 files changed, 7 insertions, 4 deletions
diff --git a/package.json b/package.json index 1b8014b..53932fa 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ }, "scripts": { "lint": "eslint .", - "test": "", + "test": "lerna run --concurrency 1 test", "bootstrap": "npm run bump && lerna bootstrap", "bump": "./scripts/bump.js", "clean": "lerna clean", diff --git a/packages/gitbook-core/src/shapes/File.js b/packages/gitbook-core/src/shapes/File.js index 6c7df3e..fb7bc06 100644 --- a/packages/gitbook-core/src/shapes/File.js +++ b/packages/gitbook-core/src/shapes/File.js @@ -6,9 +6,8 @@ const { shape } = React.PropTypes; - module.exports = shape({ mtime: instanceOf(Date).isRequired, path: string.isRequired, - type: oneOf(['markdown', 'asciidoc']).isRequired + type: oneOf(['', 'markdown', 'asciidoc']).isRequired }); diff --git a/packages/gitbook-plugin-highlight/src/CodeBlock.js b/packages/gitbook-plugin-highlight/src/CodeBlock.js index 89f6793..a556d36 100644 --- a/packages/gitbook-plugin-highlight/src/CodeBlock.js +++ b/packages/gitbook-plugin-highlight/src/CodeBlock.js @@ -29,7 +29,7 @@ const CodeBlock = React.createClass({ render() { const { children, className } = this.props; const content = getChildrenToText(children); - const lang = getLanguage(className); + const lang = getLanguage(className || ''); const includeCSS = <GitBook.ImportCSS href="gitbook/highlight/white.css" />; diff --git a/packages/gitbook/src/browser/__tests__/render.js b/packages/gitbook/src/browser/__tests__/render.js new file mode 100644 index 0000000..799be44 --- /dev/null +++ b/packages/gitbook/src/browser/__tests__/render.js @@ -0,0 +1,4 @@ + +describe('render', () => { + +}); |