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%; }
", }, ], @@ -204,8 +203,7 @@ Object { }, "type": "html", "value": "
-
<html></html>
-
+
<html></html>
", }, ], @@ -391,8 +389,7 @@ Object { }, "type": "html", "value": "
-
const foo = \\"bar\\";
-
+
const foo = \\"bar\\";
", }, ], @@ -771,8 +768,7 @@ Object { }, "type": "html", "value": "
-
# Hi
-
+
# Hi
", }, ], @@ -829,8 +825,7 @@ Object { }, "type": "html", "value": "
-
name: Brian Vaughn
-
+
name: Brian Vaughn
", }, ], @@ -1008,8 +1003,7 @@ Object { }, "type": "html", "value": "
-
pwd
-
+
pwd
", }, ], @@ -1191,8 +1185,7 @@ Object { }, "type": "html", "value": "
-
const foo = \\"bar\\";
-
+
const foo = \\"bar\\";
", }, ], @@ -1249,8 +1242,7 @@ Object { }, "type": "html", "value": "
-
console.log(\\"oops!\\");
-
+
console.log(\\"oops!\\");
", }, ], diff --git a/packages/gatsby-remark-prismjs/src/__tests__/__snapshots__/index.js.snap b/packages/gatsby-remark-prismjs/src/__tests__/__snapshots__/index.js.snap index 23fbb7bf76515..26bc18af2cc21 100644 --- a/packages/gatsby-remark-prismjs/src/__tests__/__snapshots__/index.js.snap +++ b/packages/gatsby-remark-prismjs/src/__tests__/__snapshots__/index.js.snap @@ -23,8 +23,7 @@ Object { }, "type": "html", "value": "
-
// Fake
-
+
// Fake
", }, ], @@ -110,8 +109,7 @@ Object { }, "type": "html", "value": "
-
// Fake
-
+
// Fake
", }, ], @@ -151,8 +149,7 @@ Object { }, }, "type": "html", - "value": ".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 {