starlight-cannoli-plugins 1.2.11 → 1.2.12

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.
@@ -1,7 +1,8 @@
1
1
  import {
2
+ LATEX_BLOCK_REGEX,
2
3
  compileLatexToSvg,
3
4
  hashLatexCode
4
- } from "./chunk-QZUB4DOG.js";
5
+ } from "./chunk-W3HDFLM5.js";
5
6
 
6
7
  // src/plugins/remark-latex-compile/index.ts
7
8
  import { resolve } from "path";
@@ -120,7 +121,10 @@ function getLineNumber(content, position) {
120
121
  }
121
122
  async function processMarkdownFile(filePath, svgOutputDir) {
122
123
  const content = await readFile(filePath, "utf-8");
123
- const latexBlockRegex = /```(?:tex|latex)\s+compile\r?\n([\s\S]*?)\r?\n```/g;
124
+ const latexBlockRegex = new RegExp(
125
+ LATEX_BLOCK_REGEX.source,
126
+ LATEX_BLOCK_REGEX.flags
127
+ );
124
128
  const matches = content.matchAll(latexBlockRegex);
125
129
  for (const match of matches) {
126
130
  const latexCode = match[1];
@@ -158,7 +162,10 @@ async function scanMarkdownForHashes(dir, hashes) {
158
162
  await scanMarkdownForHashes(fullPath, hashes);
159
163
  } else if (entry.isFile() && (entry.name.endsWith(".md") || entry.name.endsWith(".mdx"))) {
160
164
  const content = await readFile(fullPath, "utf-8");
161
- const latexBlockRegex = /```(?:tex|latex)\s+compile\r?\n([\s\S]*?)\r?\n```/g;
165
+ const latexBlockRegex = new RegExp(
166
+ LATEX_BLOCK_REGEX.source,
167
+ LATEX_BLOCK_REGEX.flags
168
+ );
162
169
  const matches = content.matchAll(latexBlockRegex);
163
170
  for (const match of matches) {
164
171
  const latexCode = match[1];
@@ -162,6 +162,7 @@ ${formattedSource}
162
162
  }
163
163
 
164
164
  // src/plugins/remark-latex-compile/compile.ts
165
+ var LATEX_BLOCK_REGEX = /```(?:tex|latex)\s+compile\r?\n([\s\S]*?)\r?\n```/g;
165
166
  function hashLatexCode(code) {
166
167
  const normalized = code.split("\n").map((line) => line.trim()).filter((line) => !line.startsWith("%")).filter(Boolean).join("\n").trim();
167
168
  return createHash("md5").update(normalized).digest("hex").slice(0, 16);
@@ -250,6 +251,7 @@ Error: ${errorOutput}`
250
251
  }
251
252
 
252
253
  export {
254
+ LATEX_BLOCK_REGEX,
253
255
  hashLatexCode,
254
256
  compileLatexToSvg
255
257
  };
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
+ LATEX_BLOCK_REGEX,
3
4
  hashLatexCode
4
- } from "../chunk-QZUB4DOG.js";
5
+ } from "../chunk-W3HDFLM5.js";
5
6
  import "../chunk-QGM4M3NI.js";
6
7
 
7
8
  // scripts/cli/cannoli-latex-cleanup.ts
@@ -42,7 +43,10 @@ async function scanMarkdownForHashes(dir, hashes) {
42
43
  await scanMarkdownForHashes(fullPath, hashes);
43
44
  } else if (entry.isFile() && (entry.name.endsWith(".md") || entry.name.endsWith(".mdx"))) {
44
45
  const content = await readFile(fullPath, "utf-8");
45
- const latexBlockRegex = /```(?:tex|latex)\s+compile\r?\n([\s\S]*?)\r?\n```/g;
46
+ const latexBlockRegex = new RegExp(
47
+ LATEX_BLOCK_REGEX.source,
48
+ LATEX_BLOCK_REGEX.flags
49
+ );
46
50
  const matches = content.matchAll(latexBlockRegex);
47
51
  for (const match of matches) {
48
52
  const latexCode = match[1];
package/dist/index.js CHANGED
@@ -7,12 +7,12 @@ import {
7
7
  import {
8
8
  remarkLatexCompile,
9
9
  starlightLatexCompile
10
- } from "./chunk-7C6N6IOU.js";
10
+ } from "./chunk-JZJHH56Q.js";
11
11
  import {
12
12
  starlightSyncDocsToPublic
13
13
  } from "./chunk-GE24XGG7.js";
14
14
  import "./chunk-3ATSZG6H.js";
15
- import "./chunk-QZUB4DOG.js";
15
+ import "./chunk-W3HDFLM5.js";
16
16
  import "./chunk-QGM4M3NI.js";
17
17
 
18
18
  // src/plugins/astro-normalize-paths.ts
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  remarkLatexCompile,
3
3
  starlightLatexCompile
4
- } from "../chunk-7C6N6IOU.js";
4
+ } from "../chunk-JZJHH56Q.js";
5
5
  import {
6
6
  compileLatexToSvg
7
- } from "../chunk-QZUB4DOG.js";
7
+ } from "../chunk-W3HDFLM5.js";
8
8
  import "../chunk-QGM4M3NI.js";
9
9
  export {
10
10
  compileLatexToSvg,
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  starlightLatexCompile,
3
3
  starlight_plugin_default
4
- } from "../chunk-7C6N6IOU.js";
5
- import "../chunk-QZUB4DOG.js";
4
+ } from "../chunk-JZJHH56Q.js";
5
+ import "../chunk-W3HDFLM5.js";
6
6
  import "../chunk-QGM4M3NI.js";
7
7
  export {
8
8
  starlight_plugin_default as default,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "starlight-cannoli-plugins",
3
3
  "type": "module",
4
- "version": "1.2.11",
4
+ "version": "1.2.12",
5
5
  "description": "Starlight plugins for automatic sidebar generation and link validation",
6
6
  "license": "ISC",
7
7
  "main": "./dist/index.js",