@mdream/nuxt 0.8.0 → 0.8.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.
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { join, dirname, relative, resolve } from 'node:path';
|
|
1
2
|
import { useNuxt, defineNuxtModule, createResolver, addTypeTemplate, addServerHandler } from '@nuxt/kit';
|
|
2
3
|
import { defu } from 'defu';
|
|
3
4
|
import { useSiteConfig, installNuxtSiteConfig } from 'nuxt-site-config/kit';
|
|
4
|
-
import { join, dirname, relative, resolve } from 'node:path';
|
|
5
5
|
import { mkdir, writeFile } from 'node:fs/promises';
|
|
6
6
|
import { consola } from 'consola';
|
|
7
7
|
import { htmlToMarkdown, generateLlmsTxtArtifacts } from 'mdream';
|
|
@@ -13,7 +13,7 @@ const logger = consola.withTag("nuxt-mdream");
|
|
|
13
13
|
function isIndexable(html) {
|
|
14
14
|
const robotsMatch = html.match(/<meta\s+name=["']robots["']\s+content=["']([^"']+)["']/i);
|
|
15
15
|
if (robotsMatch) {
|
|
16
|
-
const content = robotsMatch[1].toLowerCase();
|
|
16
|
+
const content = String(robotsMatch[1]).toLowerCase();
|
|
17
17
|
return !content.includes("noindex");
|
|
18
18
|
}
|
|
19
19
|
return true;
|
|
@@ -38,7 +38,7 @@ function setupPrerenderHandler(config, nuxt = useNuxt()) {
|
|
|
38
38
|
...config.mdreamOptions
|
|
39
39
|
});
|
|
40
40
|
const titleMatch = html.match(/<title[^>]*>([^<]+)<\/title>/i);
|
|
41
|
-
const title = titleMatch ? titleMatch[1].trim() : route.route;
|
|
41
|
+
const title = titleMatch ? String(titleMatch[1]).trim() : route.route;
|
|
42
42
|
pages.push({
|
|
43
43
|
url: route.route,
|
|
44
44
|
title,
|
|
@@ -97,7 +97,7 @@ const module = defineNuxtModule({
|
|
|
97
97
|
version,
|
|
98
98
|
configKey: "mdream",
|
|
99
99
|
compatibility: {
|
|
100
|
-
nuxt: "
|
|
100
|
+
nuxt: ">=3.0.0"
|
|
101
101
|
}
|
|
102
102
|
},
|
|
103
103
|
defaults: {
|
|
@@ -7,7 +7,7 @@ const logger = consola.withTag("nuxt-mdream");
|
|
|
7
7
|
function isIndexable(html) {
|
|
8
8
|
const robotsMatch = html.match(/<meta\s+name=["']robots["']\s+content=["']([^"']+)["']/i);
|
|
9
9
|
if (robotsMatch) {
|
|
10
|
-
const content = robotsMatch[1].toLowerCase();
|
|
10
|
+
const content = String(robotsMatch[1]).toLowerCase();
|
|
11
11
|
return !content.includes("noindex");
|
|
12
12
|
}
|
|
13
13
|
return true;
|
|
@@ -73,7 +73,7 @@ export default defineEventHandler(async (event) => {
|
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
75
|
const titleMatch = html.match(/<title[^>]*>([^<]+)<\/title>/i);
|
|
76
|
-
const title = titleMatch ? titleMatch[1].trim() : htmlPath;
|
|
76
|
+
const title = titleMatch ? String(titleMatch[1]).trim() : htmlPath;
|
|
77
77
|
const markdown = await convertHtmlToMarkdown(
|
|
78
78
|
html,
|
|
79
79
|
requestUrl.origin + htmlPath,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mdream/nuxt",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.8.
|
|
4
|
+
"version": "0.8.1",
|
|
5
5
|
"description": "Nuxt module for converting HTML pages to Markdown using mdream",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"exports": {
|
|
@@ -26,25 +26,25 @@
|
|
|
26
26
|
"nuxt": "^3.0.0"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@nuxt/kit": "^
|
|
29
|
+
"@nuxt/kit": "^4.0.0",
|
|
30
30
|
"consola": "^3.4.2",
|
|
31
31
|
"defu": "^6.1.4",
|
|
32
32
|
"nuxt-site-config": "^3.2.2",
|
|
33
33
|
"pathe": "^2.0.3",
|
|
34
|
-
"mdream": "0.8.
|
|
34
|
+
"mdream": "0.8.1"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@antfu/eslint-config": "^4.
|
|
37
|
+
"@antfu/eslint-config": "^4.17.0",
|
|
38
38
|
"@arethetypeswrong/cli": "^0.18.2",
|
|
39
39
|
"@nuxt/devtools": "latest",
|
|
40
40
|
"@nuxt/module-builder": "^1.0.1",
|
|
41
|
-
"@nuxt/schema": "^
|
|
41
|
+
"@nuxt/schema": "^4.0.0",
|
|
42
42
|
"@nuxt/test-utils": "^3.19.2",
|
|
43
43
|
"@types/node": "latest",
|
|
44
44
|
"bumpp": "^10.2.0",
|
|
45
45
|
"changelogen": "^0.6.2",
|
|
46
|
-
"eslint": "^9.
|
|
47
|
-
"nuxt": "^
|
|
46
|
+
"eslint": "^9.31.0",
|
|
47
|
+
"nuxt": "^4.0.0",
|
|
48
48
|
"typescript": "^5.8.3",
|
|
49
49
|
"vitest": "^3.2.4"
|
|
50
50
|
},
|