@shikijs/core 1.11.0 → 1.11.2

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.
Files changed (2) hide show
  1. package/dist/index.mjs +4 -1
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -770,6 +770,9 @@ function codeToTokensWithThemes(internal, code, options) {
770
770
  variants: {},
771
771
  offset: _token.offset,
772
772
  };
773
+ if ('includeExplanation' in options && options.includeExplanation) {
774
+ mergedToken.explanation = _token.explanation;
775
+ }
773
776
  tokens.forEach((t, themeIdx) => {
774
777
  const { content: _, explanation: __, offset: ___, ...styles } = t[lineIdx][tokenIdx];
775
778
  mergedToken.variants[themes[themeIdx].color] = styles;
@@ -863,7 +866,7 @@ function codeToTokens(internal, code, options) {
863
866
  rootStyle = defaultColor ? undefined : [fg, bg].join(';');
864
867
  }
865
868
  else if ('theme' in options) {
866
- const colorReplacements = resolveColorReplacements(options.theme, options.colorReplacements);
869
+ const colorReplacements = resolveColorReplacements(options.theme, options);
867
870
  tokens = codeToTokensBase(internal, code, options);
868
871
  const _theme = internal.getTheme(options.theme);
869
872
  bg = applyColorReplacements(_theme.bg, colorReplacements);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shikijs/core",
3
3
  "type": "module",
4
- "version": "1.11.0",
4
+ "version": "1.11.2",
5
5
  "description": "Core of Shiki",
6
6
  "author": "Pine Wu <octref@gmail.com>; Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",