Skip to content

Commit

Permalink
Cleaned up gatsby-remark-prismjs hack a little
Browse files Browse the repository at this point in the history
  • Loading branch information
bvaughn committed Nov 24, 2017
1 parent 2f350f6 commit bded111
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/gatsby-remark-embed-snippet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"author": "Brian Vaughn <brian.david.vaughn@gmail.com>",
"dependencies": {
"babel-runtime": "^6.26.0",
"gatsby-remark-prismjs": "^1.2.9",
"normalize-path": "^2.1.1",
"unist-util-map": "^1.0.3"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/gatsby-remark-embed-snippet/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ const fs = require(`fs`)
const normalizePath = require(`normalize-path`)
const visit = require(`unist-util-visit`)

// TODO: This is a terrible hack!
// Let's find a real way to share this utility code between these 2 plug-ins?
const highlightCode = require(`../../gatsby-remark-prismjs/src/highlight-code`)
// HACK: It would be nice to find a better way to share this utility code.
const highlightCode = require(`gatsby-remark-prismjs/highlight-code`)

// Language defaults to extension.toLowerCase();
// This map tracks languages that don't match their extension.
Expand Down Expand Up @@ -88,6 +87,7 @@ module.exports = (
return line
})
.join('\n')
.trim()

// PrismJS's theme styles are targeting pre[class*="language-"]
// to apply its styles. We do the same here so that users
Expand Down

0 comments on commit bded111

Please # to comment.