fumadocs-core 16.15.18 → 16.16.1

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,7 @@
1
1
  import { remarkHeading } from "./remark-heading.js";
2
2
  import { generateCodeBlockTabs, parseCodeBlockAttributes } from "./codeblock-utils.js";
3
3
  import { remarkGfm } from "./remark-gfm.js";
4
- import { r as transformerTab } from "../rehype-code.core-BwKlAUQz.js";
4
+ import { r as transformerTab } from "../rehype-code.core-BFENmmvo.js";
5
5
  import { transformerIcon } from "./transformer-icon.js";
6
6
  import { rehypeCode, rehypeCodeDefaultOptions } from "./rehype-code.js";
7
7
  import { remarkImage } from "./remark-image.js";
@@ -1,3 +1,3 @@
1
- import { n as rehypeCodeDefaultOptions, r as transformerTab, t as createRehypeCode } from "../rehype-code.core-BwKlAUQz.js";
1
+ import { n as rehypeCodeDefaultOptions, r as transformerTab, t as createRehypeCode } from "../rehype-code.core-BFENmmvo.js";
2
2
  import { transformerIcon } from "./transformer-icon.js";
3
3
  export { createRehypeCode, rehypeCodeDefaultOptions, transformerIcon, transformerTab };
@@ -1,5 +1,5 @@
1
1
  import { defaultShikiFactory, wasmShikiFactory } from "../highlight/shiki/full.js";
2
- import { n as rehypeCodeDefaultOptions$1, r as transformerTab, t as createRehypeCode } from "../rehype-code.core-BwKlAUQz.js";
2
+ import { n as rehypeCodeDefaultOptions$1, r as transformerTab, t as createRehypeCode } from "../rehype-code.core-BFENmmvo.js";
3
3
  import { transformerIcon } from "./transformer-icon.js";
4
4
  //#region src/mdx-plugins/rehype-code.ts
5
5
  const rehypeCodeDefaultOptions = {
@@ -121,10 +121,11 @@ function transformerAddLanguage(lang) {
121
121
  };
122
122
  }
123
123
  //#endregion
124
- //#region ../../node_modules/.pnpm/@shikijs+transformers@4.4.3/node_modules/@shikijs/transformers/dist/index.mjs
124
+ //#region ../../node_modules/.pnpm/@shikijs+transformers@4.5.0/node_modules/@shikijs/transformers/dist/index.mjs
125
125
  const RE_SPLIT_COMMENT = /(\s+\/\/)/;
126
126
  const RE_V1_END_COMMENT_PREFIX = /(?:\/\/|["'#]|;{1,2}|%{1,2}|--)(\s*)$/;
127
127
  const RE_V3_END_COMMENT_PREFIX = /(?:\/\/|#|;{1,2}|%{1,2}|--)(\s*)$/;
128
+ const RE_LINE_COMMENT_PREFIX = /^(?:\/\/|["'#]|;{1,2}|%{1,2}|--)$/;
128
129
  /**
129
130
  * some comment formats have to be located at the end of line
130
131
  * hence we can skip matching them for other tokens
@@ -184,7 +185,7 @@ function parseComments(lines, jsx, matchAlgorithm) {
184
185
  const prevToken = elements[i - 1];
185
186
  if (prevToken?.type === "element") {
186
187
  const prevHead = prevToken.children.at(0);
187
- if (prevHead?.type === "text" && prevHead.value.includes("//")) {
188
+ if (prevHead?.type === "text" && (prevHead.value.includes("//") || RE_LINE_COMMENT_PREFIX.test(prevHead.value.trim()))) {
188
189
  const combinedMatch = matchToken(prevHead.value + head.value, isLast);
189
190
  if (combinedMatch) {
190
191
  match = combinedMatch;
@@ -270,6 +271,7 @@ function v3ClearEndCommentPrefix(text) {
270
271
  if (match && match[1].trim().length === 0) return text.slice(0, match.index).trimEnd();
271
272
  return text;
272
273
  }
274
+ const RE_NOTATION = /#?\s*\[!code\b(?:\\.|[^\]])*\]/gi;
273
275
  function createCommentNotationTransformer(name, regex, onMatch, matchAlgorithm) {
274
276
  matchAlgorithm ??= "v3";
275
277
  return {
@@ -284,7 +286,8 @@ function createCommentNotationTransformer(name, regex, onMatch, matchAlgorithm)
284
286
  for (const comment of parsed) {
285
287
  if (comment.info[1].length === 0) continue;
286
288
  let lineIdx = lines.indexOf(comment.line);
287
- if (comment.isLineCommentOnly && matchAlgorithm !== "v1") lineIdx++;
289
+ const isStandaloneNotation = comment.info[1].replace(RE_NOTATION, "").replace(regex, "").trim().length === 0;
290
+ if (comment.isLineCommentOnly && isStandaloneNotation && matchAlgorithm !== "v1") lineIdx++;
288
291
  let replaced = false;
289
292
  comment.info[1] = comment.info[1].replace(regex, (...match) => {
290
293
  if (onMatch.call(this, match, comment.line, comment.token, lines, lineIdx)) {
@@ -449,12 +452,13 @@ function inheritElement(original, overrides) {
449
452
  const RE_CODE_WORD = /\s*\[!code word:((?:\\.|[^:\]])+)(:\d+)?\]/;
450
453
  const RE_UNESCAPE = /\\(.)/g;
451
454
  function transformerNotationWordHighlight(options = {}) {
452
- const { classActiveWord = "highlighted-word", classActivePre = void 0 } = options;
455
+ const { classActiveWord = "highlighted-word", classActivePre = void 0, classActiveCode = void 0 } = options;
453
456
  return createCommentNotationTransformer("@shikijs/transformers:notation-highlight-word", RE_CODE_WORD, function([_, word, range], _line, comment, lines, index) {
454
457
  const lineNum = range ? Number.parseInt(range.slice(1), 10) : lines.length;
455
458
  word = word.replace(RE_UNESCAPE, "$1");
456
459
  for (let i = index; i < Math.min(index + lineNum, lines.length); i++) highlightWordInLine.call(this, lines[i], comment, word, classActiveWord);
457
460
  if (classActivePre) this.addClassToHast(this.pre, classActivePre);
461
+ if (classActiveCode) this.addClassToHast(this.code, classActiveCode);
458
462
  return true;
459
463
  }, options.matchAlgorithm);
460
464
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-core",
3
- "version": "16.15.18",
3
+ "version": "16.16.1",
4
4
  "description": "The React.js library for building a documentation website",
5
5
  "keywords": [
6
6
  "Docs",
@@ -118,40 +118,40 @@
118
118
  "hast-util-to-estree": "^3.1.3",
119
119
  "hast-util-to-jsx-runtime": "^2.3.6",
120
120
  "mdast-util-mdx": "^3.0.0",
121
- "mdast-util-to-markdown": "^2.1.2",
121
+ "mdast-util-to-markdown": "^2.1.3",
122
122
  "npm-to-yarn": "3.2.0",
123
123
  "remark": "^15.0.1",
124
124
  "remark-gfm": "^4.0.1",
125
125
  "remark-rehype": "^11.1.2",
126
126
  "scroll-into-view-if-needed": "^3.1.0",
127
- "shiki": "^4.4.3",
127
+ "shiki": "^4.5.0",
128
128
  "tinyglobby": "^0.2.17",
129
129
  "unified": "^11.0.5",
130
130
  "unist-util-visit": "^5.1.0",
131
131
  "vfile": "^6.0.3",
132
132
  "yaml": "^2.9.1",
133
- "zbsearch": "^4.0.0"
133
+ "zbsearch": "^4.0.1"
134
134
  },
135
135
  "devDependencies": {
136
136
  "@formatjs/intl-localematcher": "^0.9.0",
137
137
  "@mdx-js/mdx": "^3.1.1",
138
138
  "@mixedbread/sdk": "0.78.0",
139
- "@modelcontextprotocol/server": "2.0.0",
139
+ "@modelcontextprotocol/server": "2.2.0",
140
140
  "@orama/core": "^1.2.19",
141
141
  "@oramacloud/client": "^2.1.4",
142
- "@shikijs/transformers": "^4.4.3",
143
- "@tanstack/react-router": "1.170.38",
142
+ "@shikijs/transformers": "^4.5.0",
143
+ "@tanstack/react-router": "1.170.41",
144
144
  "@types/estree-jsx": "^1.0.5",
145
145
  "@types/hast": "^3.0.5",
146
146
  "@types/mdast": "^4.0.4",
147
- "@types/node": "26.6.1",
147
+ "@types/node": "26.6.4",
148
148
  "@types/react": "^19.3.0",
149
149
  "@types/react-dom": "^19.3.0",
150
150
  "algoliasearch": "5.59.0",
151
151
  "flexsearch": "^0.8.212",
152
- "lucide-react": "^1.47.0",
152
+ "lucide-react": "^1.50.0",
153
153
  "meilisearch": "0.62.0",
154
- "next": "16.3.5",
154
+ "next": "16.3.8",
155
155
  "path-to-regexp": "^8.4.2",
156
156
  "react-router": "^8.4.0",
157
157
  "rehype-raw": "^7.0.0",
@@ -160,7 +160,7 @@
160
160
  "tsconfig": "0.0.0",
161
161
  "tsdown": "0.23.0",
162
162
  "typescript": "^7.0.2",
163
- "waku": "1.0.0-rc.1",
163
+ "waku": "1.0.0-rc.2",
164
164
  "zod": "4.6.5"
165
165
  },
166
166
  "peerDependencies": {
@@ -250,7 +250,7 @@
250
250
  "inlinedDependencies": {
251
251
  "@formatjs/fast-memoize": "3.1.7",
252
252
  "@formatjs/intl-localematcher": "0.9.0",
253
- "@shikijs/transformers": "4.4.3",
253
+ "@shikijs/transformers": "4.5.0",
254
254
  "path-to-regexp": "8.4.2"
255
255
  },
256
256
  "scripts": {