@@ -13,10 +13,9 @@ export interface JaamdOptions {
1313
1414 /**
1515 * Shiki syntax-highlighting theme family.
16- * Selects between `github-light` and `github-dark`.
17- * @default "light"
16+ * @default "github-light"
1817 */
19- theme ?: "light" | "dark" ;
18+ theme ?: string ;
2019
2120 /**
2221 * Skip injecting the default CSS variable fallbacks (`jaamd/default`).
@@ -48,7 +47,12 @@ export interface JaamdOptions {
4847 * Supports `astro add jaamd`.
4948 */
5049export default function jaamd ( options : JaamdOptions = { } ) : AstroIntegration {
51- const { selector = ".jaamd-content" , theme = "light" , noDefault = false , plugins = { } } = options ;
50+ const {
51+ selector = ".jaamd-content" ,
52+ theme = "github-light" ,
53+ noDefault = false ,
54+ plugins = { } ,
55+ } = options ;
5256 const { codeTabs = true , alerts = true , directive = true } = plugins ;
5357
5458 return {
@@ -67,11 +71,10 @@ export default function jaamd(options: JaamdOptions = {}): AstroIntegration {
6771 const existingRemarkPlugins : any [ ] = existingMarkdown . remarkPlugins ?? [ ] ;
6872 const existingShikiConfig : any = existingMarkdown . shikiConfig ?? { } ;
6973
70- // Apply sensible defaults for shikiConfig only when the user hasn't
71- // already set those specific keys.
72- const shikiTheme = theme === "dark" ? "github-dark" : "github-light" ;
73- const shikiDefaults : any = { theme : shikiTheme , wrap : true } ;
74- const mergedShikiConfig = { ...shikiDefaults , ...existingShikiConfig } ;
74+ // `wrap` and other keys are only filled in when absent.
75+ const mergedShikiConfig : any = { ...existingShikiConfig } ;
76+ mergedShikiConfig . theme = theme ;
77+ if ( mergedShikiConfig . wrap === undefined ) mergedShikiConfig . wrap = true ;
7578
7679 updateConfig ( {
7780 vite : {
0 commit comments