diff --git a/packages/gatsby-remark-embed-snippet/src/__tests__/__snapshots__/index.js.snap b/packages/gatsby-remark-embed-snippet/src/__tests__/__snapshots__/index.js.snap index a5ac077c25a61..19a759e5ab8f3 100644 --- a/packages/gatsby-remark-embed-snippet/src/__tests__/__snapshots__/index.js.snap +++ b/packages/gatsby-remark-embed-snippet/src/__tests__/__snapshots__/index.js.snap @@ -21,8 +21,7 @@ Object { }, "type": "html", "value": "
html { height: 100%; }
-
+ html { height: 100%; }
<html></html>
-
+ <html></html>
const foo = \\"bar\\";
-
+ const foo = \\"bar\\";
# Hi
-
+ # Hi
name: Brian Vaughn
-
+ name: Brian Vaughn
pwd
-
+ pwd
const foo = \\"bar\\";
-
+ const foo = \\"bar\\";
console.log(\\"oops!\\");
-
+ console.log(\\"oops!\\");
// Fake
-
+ // Fake
// Fake
-
+ // Fake
.foo { color: red }
-
",
+ "value": ".foo { color: red }
",
},
],
"position": Position {
@@ -262,8 +259,7 @@ Object {
},
},
"type": "html",
- "value": "Fake
-
",
+ "value": "Fake
",
},
],
"position": Position {
diff --git a/packages/gatsby-remark-prismjs/src/highlight-code.js b/packages/gatsby-remark-prismjs/src/highlight-code.js
index 98b6e8de1f8e1..351dca4b921ea 100644
--- a/packages/gatsby-remark-prismjs/src/highlight-code.js
+++ b/packages/gatsby-remark-prismjs/src/highlight-code.js
@@ -21,7 +21,7 @@ module.exports = (language, code, lineNumbersHighlight = []) => {
const lang = Prism.languages[language]
let highlightedCode = Prism.highlight(code, lang)
- if (lineNumbersHighlight) {
+ if (lineNumbersHighlight.length > 0) {
const codeSplits = highlightedCode.split(`\n`).map((split, i) => {
if (_.includes(lineNumbersHighlight, i + 1)) {
return {