@plurnk/plurnk-mimetypes-text-html 1.3.4 → 1.3.6
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/.env.defaults +4 -0
- package/README.md +1 -1
- package/dist/htmlToMarkdown.d.ts.map +1 -1
- package/dist/htmlToMarkdown.js +2 -1
- package/dist/htmlToMarkdown.js.map +1 -1
- package/dist/wrapMarkdown.d.ts +3 -0
- package/dist/wrapMarkdown.d.ts.map +1 -0
- package/dist/wrapMarkdown.js +115 -0
- package/dist/wrapMarkdown.js.map +1 -0
- package/package.json +4 -3
package/.env.defaults
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
# Model-facing Markdown projected from HTML wraps prose at this column so line
|
|
2
|
+
# scopes remain useful even when a source page stores whole paragraphs on one
|
|
3
|
+
# line. 0 disables wrapping. Raw HTML and structural channels are unchanged.
|
|
4
|
+
PLURNK_MIMETYPES_HTML_WRAP_COLUMNS=100
|
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ npm i @plurnk/plurnk-mimetypes-text-html
|
|
|
10
10
|
|
|
11
11
|
## what it does
|
|
12
12
|
|
|
13
|
-
- `content(content)` — the **content channel** (SPEC §18): the page's markup-free reading markdown. Main-content extraction via Readability strips nav, ads, and chrome; turndown renders the article body as markdown. Non-article pages (apps, forms, fragments, very short HTML) degrade to best-effort markdown of the `<body>` — never raw HTML, never a throw. Empty/whitespace input → absent. This is also the embed-source: an HTML entry's embedding reflects the article, not `<div class>` noise. HTML is the only mimetype that populates this channel.
|
|
13
|
+
- `content(content)` — the **content channel** (SPEC §18): the page's markup-free reading markdown. Main-content extraction via Readability strips nav, ads, and chrome; turndown renders the article body as markdown. Prose wraps at `PLURNK_MIMETYPES_HTML_WRAP_COLUMNS` (default `100`; `0` disables) so line-scoped reads remain useful on dense pages. Non-article pages (apps, forms, fragments, very short HTML) degrade to best-effort markdown of the `<body>` — never raw HTML, never a throw. Empty/whitespace input → absent. This is also the embed-source: an HTML entry's embedding reflects the article, not `<div class>` noise. HTML is the only mimetype that populates this channel.
|
|
14
14
|
- `extractRaw(content)` — h1–h6 headings as `heading` symbols (with `level`), `<title>` as an h1 fallback when no headings exist, and code blocks as `module` symbols. Source line numbers come from parse5's location info.
|
|
15
15
|
- `deepJson(content)` — the parse5 DOM as a nested node tree, with source-algebra attributes under the `attrs` convention (framework projects this to the deep-xml channel).
|
|
16
16
|
- `query(content, dialect, pattern)` — overrides xpath to dispatch against the real parsed DOM (XPath 1.0) instead of the projected deep-xml. regex/glob run against the same readable markdown the content channel produces (one projection, shared by `toText`).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"htmlToMarkdown.d.ts","sourceRoot":"","sources":["../src/htmlToMarkdown.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"htmlToMarkdown.d.ts","sourceRoot":"","sources":["../src/htmlToMarkdown.ts"],"names":[],"mappings":"AA2BA,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CA8B/D"}
|
package/dist/htmlToMarkdown.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { parseHTML } from "linkedom";
|
|
2
2
|
import { Readability } from "@mozilla/readability";
|
|
3
3
|
import TurndownService from "turndown";
|
|
4
|
+
import { wrapMarkdown } from "./wrapMarkdown.js";
|
|
4
5
|
// The single readable-text projection backing both content() (the content
|
|
5
6
|
// channel) and toText() (the regex/glob query surface + the framework's
|
|
6
7
|
// embed-source). One implementation, so the markdown a model READs, the text
|
|
@@ -48,7 +49,7 @@ export function htmlToMarkdown(html) {
|
|
|
48
49
|
if (articleHtml === null || articleHtml === undefined || articleHtml.trim().length === 0) {
|
|
49
50
|
articleHtml = readableBody(document);
|
|
50
51
|
}
|
|
51
|
-
const markdown = turndown.turndown(articleHtml).trim();
|
|
52
|
+
const markdown = wrapMarkdown(turndown.turndown(articleHtml).trim());
|
|
52
53
|
return markdown.length === 0 ? undefined : markdown;
|
|
53
54
|
}
|
|
54
55
|
// The readable body with noise removed: script/style/noscript/template carry no
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"htmlToMarkdown.js","sourceRoot":"","sources":["../src/htmlToMarkdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,eAAe,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"htmlToMarkdown.js","sourceRoot":"","sources":["../src/htmlToMarkdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,eAAe,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,0EAA0E;AAC1E,wEAAwE;AACxE,6EAA6E;AAC7E,6EAA6E;AAC7E,mDAAmD;AACnD,EAAE;AACF,+EAA+E;AAC/E,8EAA8E;AAC9E,4EAA4E;AAC5E,8EAA8E;AAC9E,8EAA8E;AAC9E,6EAA6E;AAC7E,8EAA8E;AAC9E,+EAA+E;AAC/E,+EAA+E;AAE/E,MAAM,QAAQ,GAAG,IAAI,eAAe,CAAC;IACjC,YAAY,EAAE,KAAK;IACnB,gBAAgB,EAAE,GAAG;IACrB,cAAc,EAAE,QAAQ;CAC3B,CAAC,CAAC;AAEH,MAAM,UAAU,cAAc,CAAC,IAAY;IACvC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAE/C,MAAM,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IACrC,yEAAyE;IACzE,IAAI,QAAQ,CAAC,eAAe,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IAExD,IAAI,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AC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC;AAChE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wrapMarkdown.d.ts","sourceRoot":"","sources":["../src/wrapMarkdown.ts"],"names":[],"mappings":"AAEA,wBAAgB,mBAAmB,IAAI,MAAM,CAU5C;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,SAAwB,GAAG,MAAM,CAwBtF"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
const knob = "PLURNK_MIMETYPES_HTML_WRAP_COLUMNS";
|
|
2
|
+
export function markdownWrapColumns() {
|
|
3
|
+
const raw = process.env[knob];
|
|
4
|
+
if (raw === undefined || raw === "") {
|
|
5
|
+
throw new Error(`${knob} is required`);
|
|
6
|
+
}
|
|
7
|
+
const columns = Number(raw);
|
|
8
|
+
if (!Number.isSafeInteger(columns) || columns < 0) {
|
|
9
|
+
throw new Error(`${knob} must be 0 or a positive integer`);
|
|
10
|
+
}
|
|
11
|
+
return columns;
|
|
12
|
+
}
|
|
13
|
+
export function wrapMarkdown(markdown, columns = markdownWrapColumns()) {
|
|
14
|
+
if (columns === 0)
|
|
15
|
+
return markdown;
|
|
16
|
+
const wrapped = [];
|
|
17
|
+
let fence = null;
|
|
18
|
+
for (const line of markdown.split("\n")) {
|
|
19
|
+
const marker = line.match(/^\s*(`{3,}|~{3,})/)?.[1] ?? null;
|
|
20
|
+
if (fence !== null) {
|
|
21
|
+
wrapped.push(line);
|
|
22
|
+
if (marker?.[0] === fence[0] && marker.length >= fence.length)
|
|
23
|
+
fence = null;
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
if (marker !== null) {
|
|
27
|
+
fence = marker;
|
|
28
|
+
wrapped.push(line);
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
if (line.length <= columns || structuralLine(line)) {
|
|
32
|
+
wrapped.push(line);
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
wrapped.push(...wrapLine(line, columns));
|
|
36
|
+
}
|
|
37
|
+
return wrapped.join("\n");
|
|
38
|
+
}
|
|
39
|
+
function structuralLine(line) {
|
|
40
|
+
const trimmed = line.trim();
|
|
41
|
+
return /^#{1,6}\s/.test(trimmed)
|
|
42
|
+
|| trimmed.includes("|")
|
|
43
|
+
|| /^ {4}/.test(line);
|
|
44
|
+
}
|
|
45
|
+
function wrapLine(line, columns) {
|
|
46
|
+
const prefix = line.match(/^(\s*(?:(?:>\s*)+|(?:[-+*]|\d+[.)])\s+)?)/)?.[1] ?? "";
|
|
47
|
+
const continuation = prefix.includes(">") ? prefix : " ".repeat(prefix.length);
|
|
48
|
+
const segments = [];
|
|
49
|
+
let rest = line;
|
|
50
|
+
let first = true;
|
|
51
|
+
while (rest.length > columns) {
|
|
52
|
+
const available = columns - (first ? 0 : continuation.length);
|
|
53
|
+
const boundary = breakAt(rest, Math.max(1, available));
|
|
54
|
+
if (boundary === null)
|
|
55
|
+
break;
|
|
56
|
+
segments.push(`${first ? "" : continuation}${rest.slice(0, boundary).trimEnd()}`);
|
|
57
|
+
rest = rest.slice(boundary).trimStart();
|
|
58
|
+
first = false;
|
|
59
|
+
}
|
|
60
|
+
segments.push(`${first ? "" : continuation}${rest}`);
|
|
61
|
+
return segments;
|
|
62
|
+
}
|
|
63
|
+
function breakAt(line, limit) {
|
|
64
|
+
const safe = [];
|
|
65
|
+
let codeTicks = 0;
|
|
66
|
+
let angle = false;
|
|
67
|
+
let linkLabel = false;
|
|
68
|
+
let destinationDepth = 0;
|
|
69
|
+
for (let i = 0; i < line.length; i++) {
|
|
70
|
+
const ch = line[i];
|
|
71
|
+
if (ch === "`" && !angle && destinationDepth === 0) {
|
|
72
|
+
let run = 1;
|
|
73
|
+
while (line[i + run] === "`")
|
|
74
|
+
run++;
|
|
75
|
+
if (codeTicks === 0)
|
|
76
|
+
codeTicks = run;
|
|
77
|
+
else if (run === codeTicks)
|
|
78
|
+
codeTicks = 0;
|
|
79
|
+
i += run - 1;
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
if (codeTicks > 0)
|
|
83
|
+
continue;
|
|
84
|
+
if (ch === "<" && destinationDepth === 0)
|
|
85
|
+
angle = true;
|
|
86
|
+
if (angle) {
|
|
87
|
+
if (ch === ">")
|
|
88
|
+
angle = false;
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
if (ch === "[" && destinationDepth === 0)
|
|
92
|
+
linkLabel = true;
|
|
93
|
+
if (linkLabel) {
|
|
94
|
+
if (ch === "]")
|
|
95
|
+
linkLabel = false;
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
if (ch === "(" && i > 0 && line[i - 1] === "]") {
|
|
99
|
+
destinationDepth = 1;
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
if (destinationDepth > 0) {
|
|
103
|
+
if (ch === "(")
|
|
104
|
+
destinationDepth++;
|
|
105
|
+
else if (ch === ")")
|
|
106
|
+
destinationDepth--;
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
if (/\s/.test(ch))
|
|
110
|
+
safe.push(i);
|
|
111
|
+
}
|
|
112
|
+
const before = safe.filter((index) => index <= limit).at(-1);
|
|
113
|
+
return before ?? safe.find((index) => index > limit) ?? null;
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=wrapMarkdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wrapMarkdown.js","sourceRoot":"","sources":["../src/wrapMarkdown.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GAAG,oCAAoC,CAAC;AAElD,MAAM,UAAU,mBAAmB;IAC/B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC9B,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,EAAE,EAAE,CAAC;QAClC,MAAM,IAAI,KAAK,CAAC,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|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.6",
|
|
4
4
|
"description": "text/html and application/xhtml+xml mimetype handler for plurnk-service. Structural extraction via parse5; readable markdown (content channel) via Readability + turndown.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,11 +40,12 @@
|
|
|
40
40
|
},
|
|
41
41
|
"files": [
|
|
42
42
|
"dist/**/*",
|
|
43
|
+
".env.defaults",
|
|
43
44
|
"README.md"
|
|
44
45
|
],
|
|
45
46
|
"scripts": {
|
|
46
47
|
"test:lint": "tsc --noEmit",
|
|
47
|
-
"test:unit": "node --conditions=plurnk-dev --test src/**/*.test.ts",
|
|
48
|
+
"test:unit": "node --conditions=plurnk-dev --env-file=.env.defaults --test src/**/*.test.ts",
|
|
48
49
|
"test": "npm run test:lint && npm run test:unit",
|
|
49
50
|
"build:dist": "tsc -p tsconfig.build.json",
|
|
50
51
|
"build": "npm run build:dist",
|
|
@@ -63,6 +64,6 @@
|
|
|
63
64
|
"@types/turndown": "^5.0.6"
|
|
64
65
|
},
|
|
65
66
|
"peerDependencies": {
|
|
66
|
-
"@plurnk/plurnk-mimetypes": "^1.3.
|
|
67
|
+
"@plurnk/plurnk-mimetypes": "^1.3.6"
|
|
67
68
|
}
|
|
68
69
|
}
|