starlight-cannoli-plugins 1.2.0 → 1.2.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.
@@ -170,6 +170,9 @@ function hashLatexCode(code) {
170
170
  return createHash("md5").update(normalized).digest("hex").slice(0, 16);
171
171
  }
172
172
  function buildLatexSource(latexCode) {
173
+ if (latexCode.includes("\\documentclass") && latexCode.includes("\\begin{document}")) {
174
+ return latexCode.trim();
175
+ }
173
176
  const separatorRegex = /%[ \t]*---/;
174
177
  const parts = latexCode.split(separatorRegex);
175
178
  let preamble = "";
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  remarkLatexCompile,
9
9
  starlightLatexCompile
10
- } from "./chunk-T4UKGKU6.js";
10
+ } from "./chunk-CLBOVNPT.js";
11
11
 
12
12
  // src/plugins/astro-normalize-paths.ts
13
13
  import { readFileSync, writeFileSync, existsSync } from "fs";
@@ -2,7 +2,7 @@ import {
2
2
  compileLatexToSvg,
3
3
  remarkLatexCompile,
4
4
  starlightLatexCompile
5
- } from "../chunk-T4UKGKU6.js";
5
+ } from "../chunk-CLBOVNPT.js";
6
6
  export {
7
7
  compileLatexToSvg,
8
8
  remarkLatexCompile as default,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  starlightLatexCompile,
3
3
  starlight_plugin_default
4
- } from "../chunk-T4UKGKU6.js";
4
+ } from "../chunk-CLBOVNPT.js";
5
5
  export {
6
6
  starlight_plugin_default as default,
7
7
  starlightLatexCompile
@@ -167,7 +167,6 @@ div > div[class="page"] > svg {
167
167
 
168
168
  // invert img.note-svg when on dark mode
169
169
  img.note-svg {
170
- color-scheme: light dark;
171
170
  padding-top: 1em;
172
171
  padding-bottom: 1em;
173
172
 
@@ -181,5 +180,9 @@ img.note-svg {
181
180
  }
182
181
 
183
182
  .tex-compiled {
184
- background-color: white;
183
+ background-color: transparent;
184
+
185
+ html[data-theme="dark"] & {
186
+ filter: invert(1) hue-rotate(180deg);
187
+ }
185
188
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "starlight-cannoli-plugins",
3
3
  "type": "module",
4
- "version": "1.2.0",
4
+ "version": "1.2.2",
5
5
  "description": "Starlight plugins for automatic sidebar generation and link validation",
6
6
  "license": "ISC",
7
7
  "main": "./dist/index.js",