@mdream/vite 0.12.2 → 0.13.0

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 +5 -1
  2. package/package.json +4 -4
package/dist/index.mjs CHANGED
@@ -120,7 +120,11 @@ function viteHtmlToMarkdownPlugin(userOptions = {}) {
120
120
  const path$1 = new URL(req.url || "", "http://localhost").pathname;
121
121
  const hasMarkdownExtension = path$1.endsWith(".md");
122
122
  const clientPrefersMarkdown = shouldServeMarkdown(req.headers.accept, req.headers["sec-fetch-dest"]);
123
- if (path$1.startsWith("/api") || path$1.startsWith("/_") || path$1.endsWith(".html")) return next();
123
+ if (path$1.startsWith("/api") || path$1.startsWith("/_") || path$1.startsWith("/@")) return next();
124
+ const lastSegment = path$1.split("/").pop() || "";
125
+ const hasExtension = lastSegment.includes(".");
126
+ const extension = hasExtension ? lastSegment.substring(lastSegment.lastIndexOf(".")) : "";
127
+ if (hasExtension && extension !== ".md") return next();
124
128
  if (!hasMarkdownExtension && !clientPrefersMarkdown) return next();
125
129
  const url = req.url;
126
130
  try {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mdream/vite",
3
3
  "type": "module",
4
- "version": "0.12.2",
4
+ "version": "0.13.0",
5
5
  "description": "Vite plugin for HTML to Markdown conversion with on-demand generation",
6
6
  "author": {
7
7
  "name": "Harlan Wilton",
@@ -43,11 +43,11 @@
43
43
  "vite": "^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0"
44
44
  },
45
45
  "dependencies": {
46
- "mdream": "0.12.2"
46
+ "mdream": "0.13.0"
47
47
  },
48
48
  "devDependencies": {
49
- "@types/node": "^24.6.2",
50
- "vite": "^7.1.7"
49
+ "@types/node": "^24.7.2",
50
+ "vite": "^7.1.9"
51
51
  },
52
52
  "scripts": {
53
53
  "build": "obuild",