@astrojs/markdown-remark 5.1.1 → 5.2.0

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.
package/dist/shiki.d.ts CHANGED
@@ -9,4 +9,4 @@ export interface ShikiHighlighter {
9
9
  meta?: string;
10
10
  }): Promise<string>;
11
11
  }
12
- export declare function createShikiHighlighter({ langs, theme, themes, wrap, transformers, }?: ShikiConfig): Promise<ShikiHighlighter>;
12
+ export declare function createShikiHighlighter({ langs, theme, themes, defaultColor, wrap, transformers, }?: ShikiConfig): Promise<ShikiHighlighter>;
package/dist/shiki.js CHANGED
@@ -18,6 +18,7 @@ async function createShikiHighlighter({
18
18
  langs = [],
19
19
  theme = "github-dark",
20
20
  themes = {},
21
+ defaultColor,
21
22
  wrap = false,
22
23
  transformers = []
23
24
  } = {}) {
@@ -43,6 +44,7 @@ async function createShikiHighlighter({
43
44
  const inline = options?.inline ?? false;
44
45
  return highlighter.codeToHtml(code, {
45
46
  ...themeOptions,
47
+ defaultColor,
46
48
  lang,
47
49
  // NOTE: while we can spread `options.attributes` here so that Shiki can auto-serialize this as rendered
48
50
  // attributes on the top-level tag, it's not clear whether it is fine to pass all attributes as meta, as
package/dist/types.d.ts CHANGED
@@ -3,7 +3,7 @@ import type * as mdast from 'mdast';
3
3
  import type { Options as RemarkRehypeOptions } from 'remark-rehype';
4
4
  import type { BuiltinTheme, LanguageRegistration, ShikiTransformer, ThemeRegistration, ThemeRegistrationRaw } from 'shiki';
5
5
  import type * as unified from 'unified';
6
- import type { VFile } from 'vfile';
6
+ import type { DataMap, VFile } from 'vfile';
7
7
  export type { Node } from 'unist';
8
8
  export type MarkdownAstroData = {
9
9
  frontmatter: Record<string, any>;
@@ -18,6 +18,7 @@ export interface ShikiConfig {
18
18
  langs?: LanguageRegistration[];
19
19
  theme?: ThemePresets | ThemeRegistration | ThemeRegistrationRaw;
20
20
  themes?: Record<string, ThemePresets | ThemeRegistration | ThemeRegistrationRaw>;
21
+ defaultColor?: 'light' | 'dark' | string | false;
21
22
  wrap?: boolean | null;
22
23
  transformers?: ShikiTransformer[];
23
24
  }
@@ -51,7 +52,7 @@ export interface MarkdownHeading {
51
52
  text: string;
52
53
  }
53
54
  export interface MarkdownVFile extends VFile {
54
- data: {
55
+ data: Record<string, unknown> & Partial<DataMap> & {
55
56
  __astroHeadings?: MarkdownHeading[];
56
57
  imagePaths?: Set<string>;
57
58
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrojs/markdown-remark",
3
- "version": "5.1.1",
3
+ "version": "5.2.0",
4
4
  "type": "module",
5
5
  "author": "withastro",
6
6
  "license": "MIT",
@@ -36,13 +36,13 @@
36
36
  "remark-gfm": "^4.0.0",
37
37
  "remark-parse": "^11.0.0",
38
38
  "remark-rehype": "^11.1.0",
39
- "remark-smartypants": "^3.0.1",
40
- "shiki": "^1.9.0",
39
+ "remark-smartypants": "^3.0.2",
40
+ "shiki": "^1.10.3",
41
41
  "unified": "^11.0.5",
42
42
  "unist-util-remove-position": "^5.0.0",
43
43
  "unist-util-visit": "^5.0.0",
44
44
  "unist-util-visit-parents": "^6.0.1",
45
- "vfile": "^6.0.1",
45
+ "vfile": "^6.0.2",
46
46
  "@astrojs/prism": "3.1.0"
47
47
  },
48
48
  "devDependencies": {