page-markdown 0.1.3 → 0.1.4
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/CHANGELOG.md +14 -0
- package/README.md +1 -1
- package/package.json +2 -2
- package/src/hidden.js +3 -2
- package/src/index.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.4 — 2026-11-02
|
|
4
|
+
|
|
5
|
+
- **text-sanctifier 1.3.8** (was 1.3.3). `removeHiddenText` now also removes
|
|
6
|
+
runs of reserved tag-plane code points (U+E0080–U+E00FF, U+E01F0–U+E0FFF),
|
|
7
|
+
which 1.3.3 did not find, and reports them as `hidden_reserved_tag_plane`.
|
|
8
|
+
The browser bundle grows to about 65.6 KB minified.
|
|
9
|
+
- A test checks that every run kind text-sanctifier can report has an
|
|
10
|
+
omission note, so a new kind fails `npm run ci` instead of reaching users
|
|
11
|
+
with no note.
|
|
12
|
+
- A test fails when any source, test, fixture or doc file holds a raw
|
|
13
|
+
invisible or control character. A test regex in 0.1.3 held four, written
|
|
14
|
+
by an editing tool that expanded `\u` escapes; they never shipped, since
|
|
15
|
+
tests are not in the package.
|
|
16
|
+
|
|
3
17
|
## 0.1.3 — 2026-10-30
|
|
4
18
|
|
|
5
19
|
First release on npm. `npm run ci` (contract suite and size check) is the
|
package/README.md
CHANGED
|
@@ -56,7 +56,7 @@ pageToMarkdown(doc, { url: "https://example.com/article" });
|
|
|
56
56
|
| `includeTitle` | `true` | Start readable output with `# <headline>`: the page's H1, else its title without the site name |
|
|
57
57
|
| `recoverLead` | `true` | Restore a lead paragraph the extractor dropped, when it matches the meta description |
|
|
58
58
|
| `pageFacts` | `false` | Append `## Page facts`: short label/value pairs outside the article (a sidebar's version or license, spec rows, infobox rows) that the extractor dropped. `extraction.pageFacts` counts them |
|
|
59
|
-
| `removeHiddenText` | `false` | Remove text hidden from people but read by models: runs of tag characters, variation selectors and
|
|
59
|
+
| `removeHiddenText` | `false` | Remove text hidden from people but read by models: runs of tag characters, variation selectors, invisible operators and reserved tag-plane code points, found by [text-sanctifier](https://github.com/iWhatty/text-sanctifier)'s `findHiddenRuns`. Applies to `markdown` (fenced code included), `fullPageMarkdown` and `metadata`. The England, Scotland and Wales flags and a lone emoji or text presentation selector are kept. `omissions` gets one entry per kind (`hidden_tag`, `hidden_variation_selector`, `hidden_invisible_operator`, `hidden_reserved_tag_plane`) with `count` runs and `chars` code points removed from `markdown` |
|
|
60
60
|
| `mode` | `"full"` | `"no_links"` keeps link text; `"text_only"` also drops structure. Fenced code is never changed |
|
|
61
61
|
| `sanitize` | see `DEFAULT_SANITIZE_OPTIONS` | `stripAds`, `extraStripSelectors` (e.g. `["[data-app-overlay]"]`), shadow limits |
|
|
62
62
|
| `readability` | `{}` | Passed to Readability |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "page-markdown",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Faithful page-to-Markdown for humans and agents: sanitize, extract the readable article, convert with GFM, and clean without losing content.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@mozilla/readability": "0.6.0",
|
|
49
|
-
"text-sanctifier": "1.3.
|
|
49
|
+
"text-sanctifier": "1.3.8",
|
|
50
50
|
"turndown": "7.2.4"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
package/src/hidden.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Optional last stage: remove characters that hide text from people but not
|
|
2
|
-
// from models (tag characters, variation-selector runs, invisible operators
|
|
3
|
-
// found by text-sanctifier's run finder. Legitimate sequences are kept: the
|
|
2
|
+
// from models (tag characters, variation-selector runs, invisible operators,
|
|
3
|
+
// reserved tag-plane code points), found by text-sanctifier's run finder. Legitimate sequences are kept: the
|
|
4
4
|
// England, Scotland and Wales flags and a lone emoji or text presentation
|
|
5
5
|
// selector. Unlike the clean stage, this also applies inside fenced code.
|
|
6
6
|
import { findHiddenRuns } from "text-sanctifier/hidden";
|
|
@@ -9,6 +9,7 @@ const NOTES = {
|
|
|
9
9
|
tag: "Hidden tag-character text removed",
|
|
10
10
|
variation_selector: "Variation selector runs removed",
|
|
11
11
|
invisible_operator: "Invisible operator runs removed",
|
|
12
|
+
reserved_tag_plane: "Reserved tag-plane runs removed",
|
|
12
13
|
};
|
|
13
14
|
|
|
14
15
|
/**
|
package/src/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { recoverLeadParagraph, chooseHeadline } from "./refine.js";
|
|
|
10
10
|
import { collectPageFacts, pageFactsMarkdown } from "./facts.js";
|
|
11
11
|
import { removeHiddenText, hiddenTextOmissions } from "./hidden.js";
|
|
12
12
|
|
|
13
|
-
export const VERSION = "0.1.
|
|
13
|
+
export const VERSION = "0.1.4";
|
|
14
14
|
|
|
15
15
|
export { sanitizeToInertDocument, DEFAULT_SANITIZE_OPTIONS, isAdvertisementElement, createInertDocument } from "./sanitize.js";
|
|
16
16
|
export { standardizeDocument } from "./standardize.js";
|