@astrojs/markdown-remark 6.0.0 → 6.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,7 +7,7 @@ function isFrontmatterValid(frontmatter) {
7
7
  }
8
8
  return typeof frontmatter === "object" && frontmatter !== null;
9
9
  }
10
- const frontmatterRE = /^---(.*?)^---/ms;
10
+ const frontmatterRE = /(?:^\uFEFF?|^\s*\n)---([\s\S]*?\n)---/;
11
11
  function extractFrontmatter(code) {
12
12
  return frontmatterRE.exec(code)?.[1];
13
13
  }
package/dist/shiki.js CHANGED
@@ -31,6 +31,7 @@ async function createShikiHighlighter({
31
31
  lang = "plaintext";
32
32
  }
33
33
  }
34
+ code = code.replace(/(?:\r\n|\r|\n)$/, "");
34
35
  const themeOptions = Object.values(themes).length ? { themes } : { theme };
35
36
  const inline = options?.inline ?? false;
36
37
  return highlighter[to === "html" ? "codeToHtml" : "codeToHast"](code, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrojs/markdown-remark",
3
- "version": "6.0.0",
3
+ "version": "6.0.1",
4
4
  "type": "module",
5
5
  "author": "withastro",
6
6
  "license": "MIT",