scholarly-parse 0.1.1 → 0.2.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.
Files changed (190) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +6 -6
  3. package/changelog/0.2.x/0.2.0.md +43 -0
  4. package/changelog/0.2.x/0.2.1.md +45 -0
  5. package/dist/detect.d.ts +3 -2
  6. package/dist/detect.d.ts.map +1 -1
  7. package/dist/detect.js +40 -18
  8. package/dist/detect.js.map +1 -1
  9. package/dist/formats/html/blocks.d.ts +3 -2
  10. package/dist/formats/html/blocks.d.ts.map +1 -1
  11. package/dist/formats/html/blocks.js +116 -114
  12. package/dist/formats/html/blocks.js.map +1 -1
  13. package/dist/formats/html/context.d.ts +17 -0
  14. package/dist/formats/html/context.d.ts.map +1 -1
  15. package/dist/formats/html/context.js +4 -0
  16. package/dist/formats/html/context.js.map +1 -1
  17. package/dist/formats/html/inline.d.ts +7 -6
  18. package/dist/formats/html/inline.d.ts.map +1 -1
  19. package/dist/formats/html/inline.js +30 -28
  20. package/dist/formats/html/inline.js.map +1 -1
  21. package/dist/formats/html/metadata.d.ts +7 -10
  22. package/dist/formats/html/metadata.d.ts.map +1 -1
  23. package/dist/formats/html/metadata.js +59 -23
  24. package/dist/formats/html/metadata.js.map +1 -1
  25. package/dist/formats/html/parse.d.ts.map +1 -1
  26. package/dist/formats/html/parse.js +207 -59
  27. package/dist/formats/html/parse.js.map +1 -1
  28. package/dist/formats/html/references.d.ts.map +1 -1
  29. package/dist/formats/html/references.js +15 -31
  30. package/dist/formats/html/references.js.map +1 -1
  31. package/dist/formats/html/subtree.d.ts +112 -0
  32. package/dist/formats/html/subtree.d.ts.map +1 -0
  33. package/dist/formats/html/subtree.js +316 -0
  34. package/dist/formats/html/subtree.js.map +1 -0
  35. package/dist/formats/jats/blocks.d.ts +4 -1
  36. package/dist/formats/jats/blocks.d.ts.map +1 -1
  37. package/dist/formats/jats/blocks.js +176 -59
  38. package/dist/formats/jats/blocks.js.map +1 -1
  39. package/dist/formats/jats/fragment.d.ts +8 -2
  40. package/dist/formats/jats/fragment.d.ts.map +1 -1
  41. package/dist/formats/jats/fragment.js +187 -7
  42. package/dist/formats/jats/fragment.js.map +1 -1
  43. package/dist/formats/jats/front.d.ts +0 -5
  44. package/dist/formats/jats/front.d.ts.map +1 -1
  45. package/dist/formats/jats/front.js +55 -33
  46. package/dist/formats/jats/front.js.map +1 -1
  47. package/dist/formats/jats/inline.d.ts +3 -3
  48. package/dist/formats/jats/inline.d.ts.map +1 -1
  49. package/dist/formats/jats/inline.js +118 -43
  50. package/dist/formats/jats/inline.js.map +1 -1
  51. package/dist/formats/jats/parse.js +43 -6
  52. package/dist/formats/jats/parse.js.map +1 -1
  53. package/dist/formats/jats/references.d.ts +0 -5
  54. package/dist/formats/jats/references.d.ts.map +1 -1
  55. package/dist/formats/jats/references.js +158 -50
  56. package/dist/formats/jats/references.js.map +1 -1
  57. package/dist/formats/jats/text.d.ts +16 -0
  58. package/dist/formats/jats/text.d.ts.map +1 -1
  59. package/dist/formats/jats/text.js +77 -1
  60. package/dist/formats/jats/text.js.map +1 -1
  61. package/dist/formats/latexml/blocks.d.ts.map +1 -1
  62. package/dist/formats/latexml/blocks.js +42 -31
  63. package/dist/formats/latexml/blocks.js.map +1 -1
  64. package/dist/formats/latexml/context.d.ts +4 -1
  65. package/dist/formats/latexml/context.d.ts.map +1 -1
  66. package/dist/formats/latexml/context.js.map +1 -1
  67. package/dist/formats/latexml/inline.d.ts +4 -3
  68. package/dist/formats/latexml/inline.d.ts.map +1 -1
  69. package/dist/formats/latexml/inline.js +10 -11
  70. package/dist/formats/latexml/inline.js.map +1 -1
  71. package/dist/formats/latexml/parse.d.ts +7 -1
  72. package/dist/formats/latexml/parse.d.ts.map +1 -1
  73. package/dist/formats/latexml/parse.js +61 -25
  74. package/dist/formats/latexml/parse.js.map +1 -1
  75. package/dist/formats/pdf/inline.d.ts +16 -0
  76. package/dist/formats/pdf/inline.d.ts.map +1 -1
  77. package/dist/formats/pdf/inline.js +45 -3
  78. package/dist/formats/pdf/inline.js.map +1 -1
  79. package/dist/formats/pdf/layout.d.ts.map +1 -1
  80. package/dist/formats/pdf/layout.js +32 -1
  81. package/dist/formats/pdf/layout.js.map +1 -1
  82. package/dist/formats/pdf/lines.d.ts +7 -1
  83. package/dist/formats/pdf/lines.d.ts.map +1 -1
  84. package/dist/formats/pdf/lines.js +17 -1
  85. package/dist/formats/pdf/lines.js.map +1 -1
  86. package/dist/formats/pdf/load.d.ts +15 -5
  87. package/dist/formats/pdf/load.d.ts.map +1 -1
  88. package/dist/formats/pdf/load.js +17 -5
  89. package/dist/formats/pdf/load.js.map +1 -1
  90. package/dist/formats/pdf/parse.d.ts +5 -0
  91. package/dist/formats/pdf/parse.d.ts.map +1 -1
  92. package/dist/formats/pdf/parse.js +9 -10
  93. package/dist/formats/pdf/parse.js.map +1 -1
  94. package/dist/formats/pdf/references.d.ts +0 -6
  95. package/dist/formats/pdf/references.d.ts.map +1 -1
  96. package/dist/formats/pdf/references.js +44 -8
  97. package/dist/formats/pdf/references.js.map +1 -1
  98. package/dist/formats/pdf/structure.d.ts +3 -1
  99. package/dist/formats/pdf/structure.d.ts.map +1 -1
  100. package/dist/formats/pdf/structure.js +89 -33
  101. package/dist/formats/pdf/structure.js.map +1 -1
  102. package/dist/formats/tei/inline.d.ts +4 -1
  103. package/dist/formats/tei/inline.d.ts.map +1 -1
  104. package/dist/formats/tei/inline.js +6 -3
  105. package/dist/formats/tei/inline.js.map +1 -1
  106. package/dist/formats/tei/parse.d.ts.map +1 -1
  107. package/dist/formats/tei/parse.js +50 -30
  108. package/dist/formats/tei/parse.js.map +1 -1
  109. package/dist/html/dom.d.ts +34 -7
  110. package/dist/html/dom.d.ts.map +1 -1
  111. package/dist/html/dom.js +459 -1
  112. package/dist/html/dom.js.map +1 -1
  113. package/dist/html/math.d.ts +7 -0
  114. package/dist/html/math.d.ts.map +1 -0
  115. package/dist/html/math.js +34 -0
  116. package/dist/html/math.js.map +1 -0
  117. package/dist/model/arxiv.d.ts +51 -0
  118. package/dist/model/arxiv.d.ts.map +1 -0
  119. package/dist/model/arxiv.js +167 -0
  120. package/dist/model/arxiv.js.map +1 -0
  121. package/dist/model/document.d.ts +22 -4
  122. package/dist/model/document.d.ts.map +1 -1
  123. package/dist/model/doi.d.ts +21 -3
  124. package/dist/model/doi.d.ts.map +1 -1
  125. package/dist/model/doi.js +45 -3
  126. package/dist/model/doi.js.map +1 -1
  127. package/dist/model/identifiers.d.ts +32 -0
  128. package/dist/model/identifiers.d.ts.map +1 -0
  129. package/dist/model/identifiers.js +61 -0
  130. package/dist/model/identifiers.js.map +1 -0
  131. package/dist/model/input.d.ts +2 -0
  132. package/dist/model/input.d.ts.map +1 -1
  133. package/dist/model/input.js +2 -1
  134. package/dist/model/input.js.map +1 -1
  135. package/dist/model/limits.d.ts +14 -0
  136. package/dist/model/limits.d.ts.map +1 -0
  137. package/dist/model/limits.js +14 -0
  138. package/dist/model/limits.js.map +1 -0
  139. package/dist/model/section-ids.d.ts +23 -2
  140. package/dist/model/section-ids.d.ts.map +1 -1
  141. package/dist/model/section-ids.js +38 -13
  142. package/dist/model/section-ids.js.map +1 -1
  143. package/dist/parse.d.ts +6 -1
  144. package/dist/parse.d.ts.map +1 -1
  145. package/dist/parse.js.map +1 -1
  146. package/dist/render/bare-url.d.ts +29 -0
  147. package/dist/render/bare-url.d.ts.map +1 -0
  148. package/dist/render/bare-url.js +207 -0
  149. package/dist/render/bare-url.js.map +1 -0
  150. package/dist/render/escape.d.ts +59 -8
  151. package/dist/render/escape.d.ts.map +1 -1
  152. package/dist/render/escape.js +225 -17
  153. package/dist/render/escape.js.map +1 -1
  154. package/dist/render/inline.d.ts +53 -9
  155. package/dist/render/inline.d.ts.map +1 -1
  156. package/dist/render/inline.js +789 -23
  157. package/dist/render/inline.js.map +1 -1
  158. package/dist/render/markdown.d.ts +14 -9
  159. package/dist/render/markdown.d.ts.map +1 -1
  160. package/dist/render/markdown.js +39 -18
  161. package/dist/render/markdown.js.map +1 -1
  162. package/dist/render/read-inline.d.ts +70 -0
  163. package/dist/render/read-inline.d.ts.map +1 -0
  164. package/dist/render/read-inline.js +376 -0
  165. package/dist/render/read-inline.js.map +1 -0
  166. package/dist/render/scan.d.ts +54 -0
  167. package/dist/render/scan.d.ts.map +1 -0
  168. package/dist/render/scan.js +145 -0
  169. package/dist/render/scan.js.map +1 -0
  170. package/dist/render/sections.d.ts +9 -5
  171. package/dist/render/sections.d.ts.map +1 -1
  172. package/dist/render/sections.js +20 -15
  173. package/dist/render/sections.js.map +1 -1
  174. package/dist/render/text.d.ts +3 -4
  175. package/dist/render/text.d.ts.map +1 -1
  176. package/dist/render/text.js +5 -182
  177. package/dist/render/text.js.map +1 -1
  178. package/dist/xml/mathml.d.ts +16 -12
  179. package/dist/xml/mathml.d.ts.map +1 -1
  180. package/dist/xml/mathml.js +110 -40
  181. package/dist/xml/mathml.js.map +1 -1
  182. package/dist/xml/ordered.d.ts +0 -6
  183. package/dist/xml/ordered.d.ts.map +1 -1
  184. package/dist/xml/ordered.js +111 -20
  185. package/dist/xml/ordered.js.map +1 -1
  186. package/dist/xml/well-formed.d.ts +11 -3
  187. package/dist/xml/well-formed.d.ts.map +1 -1
  188. package/dist/xml/well-formed.js +25 -7
  189. package/dist/xml/well-formed.js.map +1 -1
  190. package/package.json +12 -8
package/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  All notable changes to this project. Each entry links to its full per-version file in [changelog/](changelog/).
4
4
 
5
+ ## [0.2.1](changelog/0.2.x/0.2.1.md) — 2026-10-08 · 🛡️ Security
6
+
7
+ Rendered Markdown never yields a live HTML node outside link text, checked against a GFM parser, with emphasis, JATS citation, XML well-formedness, and identifier fixes.
8
+
9
+ ## [0.2.0](changelog/0.2.x/0.2.0.md) — 2026-10-06 · 🛡️ Security
10
+
11
+ Escaping that holds across element boundaries and HTML nesting bounded before the DOM is built, plus toSections entries for footnotes and references, PDF footnotes, a PDF abort signal, and parsing fixes in every format.
12
+
5
13
  ## [0.1.1](changelog/0.1.x/0.1.1.md) — 2026-09-26 · 🛡️ Security
6
14
 
7
15
  Hardening against hostile input: PDF reading budgets, one table budget per document, capped Markdown nesting, and linear-time text patterns, plus Grobid TEI outline fixes.
package/README.md CHANGED
@@ -1,11 +1,11 @@
1
1
  <div align="center">
2
2
  <h1>scholarly-parse</h1>
3
- <p><b>Parse scholarly papers — JATS, Grobid TEI, arXiv HTML, publisher HTML, PDF — into one document model and Markdown.</b></p>
3
+ <p><b>Parse scholarly papers (JATS, Grobid TEI, arXiv HTML, publisher HTML, PDF) into one document model and Markdown.</b></p>
4
4
  </div>
5
5
 
6
6
  <div align="center">
7
7
 
8
- [![Version](https://img.shields.io/badge/Version-0.1.1-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![TypeScript](https://img.shields.io/badge/TypeScript-^7.0.2-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Node](https://img.shields.io/badge/Node-%E2%89%A522-339933.svg?style=flat-square&logo=nodedotjs&logoColor=white)](https://nodejs.org/)
8
+ [![Version](https://img.shields.io/badge/Version-0.2.1-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![npm](https://img.shields.io/npm/v/scholarly-parse?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/scholarly-parse) [![TypeScript](https://img.shields.io/badge/TypeScript-^7.0.2-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Node](https://img.shields.io/badge/Node-%E2%89%A522-339933.svg?style=flat-square&logo=nodedotjs&logoColor=white)](https://nodejs.org/)
9
9
 
10
10
  </div>
11
11
 
@@ -13,7 +13,7 @@
13
13
 
14
14
  ## What it does
15
15
 
16
- `scholarly-parse` reads a paper in any of five formats — JATS XML from PubMed Central, Europe PMC, and publisher feeds; TEI from Grobid; LaTeXML HTML from arXiv; publisher article pages; and PDF — into one `ScholarlyDocument`, and renders it as Markdown. It parses only: fetching, rate limiting, and licensing decisions stay with the caller.
16
+ `scholarly-parse` reads a paper in any of five formats — JATS XML from PubMed Central, Europe PMC, and publisher feeds; TEI from Grobid; LaTeXML HTML from arXiv; publisher article pages; and PDF — into one `ScholarlyDocument`, and renders it as Markdown.
17
17
 
18
18
  ## Install
19
19
 
@@ -54,7 +54,7 @@ if (!result.ok && result.error.reason === 'blocked') {
54
54
  }
55
55
  ```
56
56
 
57
- `toSections` flattens the document into sections with their heading paths and sizes, for serving a long paper a piece at a time. Figures and tables that sit outside any section come last, as one entry:
57
+ `toSections` flattens the document into sections with their heading paths and sizes, for serving a long paper a piece at a time. Figures and tables outside any section, the footnotes, and the references come last, one entry each, and each entry's `id` renders it alone through `toMarkdown(document, { sections: [id] })`:
58
58
 
59
59
  ```ts
60
60
  import { toSections } from 'scholarly-parse';
@@ -75,9 +75,9 @@ for (const { path, chars, markdown } of toSections(document)) {
75
75
  | `scholarly-parse/html` | `parseHtml` |
76
76
  | `scholarly-parse/pdf` | `parsePdf` |
77
77
 
78
- Every parser returns `{ ok: true, document }` or `{ ok: false, error: { reason, message } }`, where `reason` is `malformed`, `wrong-format`, `empty`, `blocked`, or `too-large`. Each takes a `maxInputBytes` budget; `parseLatexml` and `parseHtml` take the page's `baseUrl` to resolve links, and `parsePdf` reading budgets counted across the document: `maxPages` (default 300), `maxTextItems` (500,000), `maxTextChars` (4,000,000), and `maxOperators` (10,000,000). A PDF that reaches one parses as far as it was read, with a `truncated-input` warning. `parseJats` and `parseTei` are synchronous; the rest are async.
78
+ Every parser returns `{ ok: true, document }` or `{ ok: false, error: { reason, message } }`, where `reason` is `malformed`, `wrong-format`, `empty`, `blocked`, or `too-large`. Each takes a `maxInputBytes` budget; `parseLatexml` and `parseHtml` take the page's `baseUrl` to resolve links (for arXiv, `https://arxiv.org/html/<id>` without a trailing slash, the only form its image paths resolve against), and `parsePdf` reading budgets counted across the document: `maxPages` (default 300), `maxTextItems` (500,000), `maxTextChars` (4,000,000), and `maxOperators` (10,000,000). A PDF that reaches one parses as far as it was read, with a `truncated-input` warning. `parseJats` and `parseTei` are synchronous; the rest are async.
79
79
 
80
- For a hard time or memory bound on untrusted PDFs, run `parsePdf` in a worker or process you can terminate.
80
+ `parsePdf` and `parse` also take a `signal`: once it is aborted (`AbortSignal.timeout(ms)`, a request's cancellation), reading stops at the next page boundary and keeps what was read, warned `truncated-input`. pdf.js reads a page without yielding, so for a hard time or memory bound on untrusted PDFs, run `parsePdf` in a worker or process you can terminate.
81
81
 
82
82
  ## Formats
83
83
 
@@ -0,0 +1,43 @@
1
+ ---
2
+ summary: "Escaping that holds across element boundaries and HTML nesting bounded before the DOM is built, plus toSections entries for footnotes and references, PDF footnotes, a PDF abort signal, and parsing fixes in every format."
3
+ breaking: false
4
+ security: true
5
+ agent-notes: |
6
+ `FlatSection.kind` gains `'footnotes'` and `'references'`: `toSections` ends with those entries after `floats` whenever the document has any, so an exhaustive `switch` on `kind` needs both cases.
7
+ Abstract-part section IDs from TEI, LaTeXML, publisher HTML, and PDF are now `abstract-<n>-<m>` (was `abstract-<n>`, `abstract`, or `s<n>`); a stored part ID needs remapping. `abstract-<digits>`, `floats`, `footnotes`, and `references` are never section IDs.
8
+ `parsePdf` now fills `document.footnotes`, so PDF Markdown can gain a `## Footnotes` section.
9
+ ---
10
+
11
+ # 0.2.0 — 2026-10-06
12
+
13
+ ## Added
14
+
15
+ - **`PdfOptions.signal` and `AutoParseOptions.signal`**: an aborted `AbortSignal` stops a PDF read at the next page boundary, keeping what was read with a `truncated-input` warning ([#17](https://github.com/cyanheads/scholarly-parse/issues/17)). With a signal, each page waits one `setTimeout` turn so a timeout can fire.
16
+ - **`toSections` ends with `footnotes` and `references` entries** after `floats`, each holding what `toMarkdown` writes for it, and `toMarkdown({ sections })` renders them ([#27](https://github.com/cyanheads/scholarly-parse/issues/27)). `FlatSection.kind` gains both.
17
+ - **PDF footnotes**: labelled notes set below a page's text before the reference list become `document.footnotes`; first-page affiliations and licences stay front matter ([#43](https://github.com/cyanheads/scholarly-parse/issues/43)).
18
+ - **`detect`** reads bytes by their UTF-8 or UTF-16 byte-order mark, skips processing instructions before the root, names an `<article class="ltx_document">` fragment LaTeXML, and names JATS inside a PMC OAI-PMH record, which `parseJats` reads with flavor `pmc` ([#31](https://github.com/cyanheads/scholarly-parse/issues/31), [#45](https://github.com/cyanheads/scholarly-parse/issues/45)).
19
+
20
+ ## Changed
21
+
22
+ - **Section IDs**: `issueId` never gives a section a `toSections` ID (`abstract-<n>`, `floats`, `footnotes`, `references`), and every reader numbers abstract parts `abstract-<n>-<m>`, so each `toSections` ID renders one entry ([#24](https://github.com/cyanheads/scholarly-parse/issues/24)).
23
+ - **Publisher HTML lead**: on a titled page with no abstract, article prose between the title and the first heading opens the body, byline still dropped ([#32](https://github.com/cyanheads/scholarly-parse/issues/32)).
24
+ - **Publisher HTML landing pages** parse as front matter and an abstract with a `no-body` warning that names a landing page; the title heading falls back to the one matching `citation_title`, and `Metadata`/`BibTeX` sections are furniture ([#30](https://github.com/cyanheads/scholarly-parse/issues/30)).
25
+ - **JATS footnotes** write every block of a note into its text (lists, formulas, code, captions; a table's rows are warned `unhandled-element`), definitions keep their paragraphs, and block elements read as inline text are spaced ([#35](https://github.com/cyanheads/scholarly-parse/issues/35)).
26
+
27
+ ## Fixed
28
+
29
+ - **DOIs** in JATS and TEI article, related-work, and reference fields lose resolver and `doi:` prefixes, through one shared `normalizeDoi` ([#38](https://github.com/cyanheads/scholarly-parse/issues/38)).
30
+ - **`toText`** strips links whose label holds brackets, and `link()` escapes a label's unpaired brackets, leaving inline math alone ([#36](https://github.com/cyanheads/scholarly-parse/issues/36)).
31
+ - **MathML** `mmultiscripts` keep prescripts and postscripts (`{}_6^{14}C`) ([#40](https://github.com/cyanheads/scholarly-parse/issues/40)), and LaTeXML and publisher HTML convert MathML that carries no TeX instead of dropping or flattening it ([#41](https://github.com/cyanheads/scholarly-parse/issues/41)).
32
+ - **Publisher HTML metadata**: `<a rel="license">` and `<area rel="license">` are read as the license ([#29](https://github.com/cyanheads/scholarly-parse/issues/29)), and an `<h1>` fallback title is escaped once ([#33](https://github.com/cyanheads/scholarly-parse/issues/33)).
33
+ - **PDF**: runs drawn under a heading no longer join its line ([#2](https://github.com/cyanheads/scholarly-parse/issues/2)); a figure's panel labels are not headings ([#3](https://github.com/cyanheads/scholarly-parse/issues/3)); bold back-matter labels after the last reference end the list ([#5](https://github.com/cyanheads/scholarly-parse/issues/5)); one- and two-entry numbered bibliographies and `68.[No title]` entries split ([#42](https://github.com/cyanheads/scholarly-parse/issues/42)); a quoted or colon-less first-page DOI is read ([#23](https://github.com/cyanheads/scholarly-parse/issues/23)).
34
+
35
+ ## Security
36
+
37
+ - **Inline escaping holds across element boundaries**: `escapeInline` closes each fragment's end and every reader runs `joinInlineSeams` over finished inline Markdown, so text split across elements cannot form raw HTML, an image, or a non-web link; citation markers are escaped ([#44](https://github.com/cyanheads/scholarly-parse/issues/44)).
38
+ - **HTML and LaTeXML nesting is bounded before the DOM is built**: tags of elements past 256 levels are dropped with their text kept and a `truncated-input` warning, and walkers read each element's subtree facts once, so deep or chained markup parses in linear time ([#7](https://github.com/cyanheads/scholarly-parse/issues/7)). Repeated self-closed `<math/>` and `<svg/>` are bounded the same way.
39
+ - **Linear-time lookups**: HTML and LaTeXML affiliations, HTML in-page link targets, JATS trailing `<notes>` ([#10](https://github.com/cyanheads/scholarly-parse/issues/10)), and a LaTeXML paragraph holding many footnotes.
40
+
41
+ ## Dependencies
42
+
43
+ - `source-map-js` 1.2.1 → 1.2.2 (transitive dev dependency through vitest; [GHSA-68fv-2mgg-jv7q](https://github.com/advisories/GHSA-68fv-2mgg-jv7q))
@@ -0,0 +1,45 @@
1
+ ---
2
+ summary: "Rendered Markdown never yields a live HTML node outside link text, checked against a GFM parser, with emphasis, JATS citation, XML well-formedness, and identifier fixes."
3
+ breaking: false
4
+ security: true
5
+ agent-notes: |
6
+ `arxiv` values changed shape in every format: HTML and PDF references keep a printed version (`2401.12345v2`), an old-style ID drops its subject class (`math.GT/0309136` → `math/0309136`), and `references[].arxiv` is filled for many more LaTeXML references. Compare stored IDs on the ID without its version, and remap stored old-style IDs that carried a subject class.
7
+ ---
8
+
9
+ # 0.2.1 — 2026-10-08
10
+
11
+ ## Added
12
+
13
+ - **GFM oracle in the tests**: rendered Markdown is parsed with micromark and its GFM extensions, and seeded property tests run the inline paths against it ([#68](https://github.com/cyanheads/scholarly-parse/issues/68)). The corpus `expect.json` gains `referenceIdentifiers`.
14
+
15
+ ## Changed
16
+
17
+ - **Documentation**: `baseUrl` for arXiv HTML is `https://arxiv.org/html/<id>` without a trailing slash, the only form its image paths resolve against.
18
+
19
+ ## Fixed
20
+
21
+ - **`toText`** no longer leaves a `**` when emphasis inside strong text opens after punctuation or a letter ([#56](https://github.com/cyanheads/scholarly-parse/issues/56)).
22
+ - **Emphasis** that GFM printed literally beside a word now renders: edge punctuation moves outside the marker (`*daf-16-*dependent` → `*daf-16*-dependent`) and touching spans of one kind join ([#72](https://github.com/cyanheads/scholarly-parse/issues/72)).
23
+ - **`__word__`** text no longer renders as emphasis ([#63](https://github.com/cyanheads/scholarly-parse/issues/63)).
24
+ - **Touching inline formulas** keep a TeX control word apart from the letter after it (`$\alpha$$x$` → `$\alpha x$`) ([#52](https://github.com/cyanheads/scholarly-parse/issues/52)).
25
+ - **A link whose text is its URL** is written as an autolink when the URL holds `~` or an underscore beside punctuation, with parentheses unencoded ([#53](https://github.com/cyanheads/scholarly-parse/issues/53)).
26
+ - **JATS citations**: touching citation `<xref>`s read `[1,2,3]` ([#57](https://github.com/cyanheads/scholarly-parse/issues/57)); `<mixed-citation>` names keep their separators and an empty `<etal/>` reads `et al.` ([#58](https://github.com/cyanheads/scholarly-parse/issues/58)); a `<name-alternatives>` no longer fuses both name forms ([#73](https://github.com/cyanheads/scholarly-parse/issues/73)).
27
+ - **`jatsInlineToMarkdown`** keeps tag-shaped text (`x<y and y>z`) and separates HTML block boundaries ([#61](https://github.com/cyanheads/scholarly-parse/issues/61)).
28
+ - **JATS**: TeX in an IOP `<?CDATA …?>` instruction reads as the formula ([#60](https://github.com/cyanheads/scholarly-parse/issues/60)), and `<app-group>` children other than `<app>` and a supplement's own paragraphs are kept ([#69](https://github.com/cyanheads/scholarly-parse/issues/69)).
29
+ - **XML well-formedness**: an apostrophe in a DOCTYPE comment no longer makes a well-formed document `malformed` ([#74](https://github.com/cyanheads/scholarly-parse/issues/74)), and a start tag whose name runs into other characters or a `<!…>` declaration outside a DOCTYPE, which the XML parser silently dropped, is `malformed`.
30
+ - **PMC IDs, PMIDs, and ORCID iDs** go through `normalizePmcid`, `normalizePmid`, and `normalizeOrcid` for every JATS, TEI, and HTML field typed as one: labels and PMC, PubMed, or orcid.org links are removed, any case reads, and a value that is not an identifier is left out ([#59](https://github.com/cyanheads/scholarly-parse/issues/59)).
31
+ - **arXiv IDs** read through one grammar in every format: LaTeXML and PDF references read old-style IDs and arxiv.org links, HTML and PDF references keep a printed version, and an old-style subject class is dropped ([#65](https://github.com/cyanheads/scholarly-parse/issues/65)).
32
+
33
+ ## Security
34
+
35
+ - **Outside link text, rendered Markdown never yields a live HTML node**: a bare URL GFM links that holds or meets an escape is written as an explicit link to the URL as the source has it, and inline TeX cannot close its own `$…$` or open a code span ([#62](https://github.com/cyanheads/scholarly-parse/issues/62), [#68](https://github.com/cyanheads/scholarly-parse/issues/68)).
36
+
37
+ ## Dependencies
38
+
39
+ - `fast-xml-parser` ^5.11.1 → ^5.11.2
40
+ - `@biomejs/biome` ^2.5.14 → ^2.5.15 (with `biome.json` `$schema`)
41
+ - `@types/node` ^26.6.2 → ^26.6.4
42
+ - `ignore` ^7.0.10 → ^7.0.12
43
+ - `publint` ^0.3.24 → ^0.3.25
44
+ - `vitest` ^5.0.1 → ^5.0.3
45
+ - `micromark` ^4.0.3, `micromark-extension-gfm` ^3.0.0, `mdast-util-from-markdown` ^2.1.0, `mdast-util-gfm` ^3.1.0 (new dev dependencies for the GFM oracle)
package/dist/detect.d.ts CHANGED
@@ -4,8 +4,9 @@
4
4
  */
5
5
  import type { SourceFormat } from './model/document.js';
6
6
  /**
7
- * The format of `input`, or undefined when it is none this package reads. A challenge or
8
- * access-denied page is `html`; the HTML parser reports it as `blocked`.
7
+ * The format of `input`, or undefined when it is none this package reads. Bytes are read
8
+ * by their byte-order mark, else as Latin-1. A challenge or access-denied page is `html`;
9
+ * the HTML parser reports it as `blocked`.
9
10
  */
10
11
  export declare function detect(input: string | Uint8Array): SourceFormat | undefined;
11
12
  //# sourceMappingURL=detect.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../src/detect.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAKxD;;;GAGG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,GAAG,YAAY,GAAG,SAAS,CAqB3E"}
1
+ {"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../src/detect.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAMxD;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,GAAG,YAAY,GAAG,SAAS,CAwB3E"}
package/dist/detect.js CHANGED
@@ -1,13 +1,13 @@
1
- /** How much of the input the sniffers read: headers and root elements sit at the start. */
2
- const SNIFF_BYTES = 64 * 1024;
1
+ import { bomEncoding } from './model/input.js';
2
+ /** How many characters of the input the sniffers read: headers and root elements sit at the start. */
3
+ const SNIFF_CHARS = 64 * 1024;
3
4
  /**
4
- * The format of `input`, or undefined when it is none this package reads. A challenge or
5
- * access-denied page is `html`; the HTML parser reports it as `blocked`.
5
+ * The format of `input`, or undefined when it is none this package reads. Bytes are read
6
+ * by their byte-order mark, else as Latin-1. A challenge or access-denied page is `html`;
7
+ * the HTML parser reports it as `blocked`.
6
8
  */
7
9
  export function detect(input) {
8
- const head = typeof input === 'string'
9
- ? input.slice(0, SNIFF_BYTES)
10
- : latin1(input.subarray(0, SNIFF_BYTES));
10
+ const head = typeof input === 'string' ? input.slice(0, SNIFF_CHARS) : opening(input);
11
11
  if (/^[\s\S]{0,1024}%PDF-/.test(head))
12
12
  return 'pdf';
13
13
  const text = head.replace(/^/, '').replace(/^\s+/, '');
@@ -16,9 +16,18 @@ export function detect(input) {
16
16
  // TEI before HTML: OpenAlex serves Grobid's TEI wrapped in an HTML page.
17
17
  if (/<TEI[\s>]|xmlns=["']http:\/\/www\.tei-c\.org\/ns\/1\.0["']/i.test(text))
18
18
  return 'tei';
19
- if (/^(?:<!DOCTYPE\s+(?:article|pmc-articleset)\b|<article[\s>]|<pmc-articleset[\s>])/i.test(afterProlog(text))) {
19
+ const root = afterProlog(text);
20
+ // LaTeXML before JATS: an arXiv fragment is rooted at `<article class="ltx_document">`.
21
+ if (/^<article\s[^<>]*\bclass\s*=\s*["'][^"'<>]*\bltx_document\b/i.test(root))
22
+ return 'latexml';
23
+ if (/^(?:<!DOCTYPE\s+(?:article|pmc-articleset)\b|<article[\s>]|<pmc-articleset[\s>])/i.test(root)) {
24
+ return 'jats';
25
+ }
26
+ // PMC's OAI-PMH record carries the article in `<metadata>`; an error or `oai_dc` record does not.
27
+ if (/^<OAI-PMH[\s>]/i.test(root) && /<metadata[^<>]*>\s*<article[\s>]/i.test(root)) {
20
28
  return 'jats';
21
29
  }
30
+ // After the JATS roots, since a JATS article's text can name the class.
22
31
  // Each `<meta` is read up to the next `<`: a run of unclosed ones is scanned once, not once per tag.
23
32
  if (/\bltx_document\b|<meta[^<>]+content=["']LaTeXML/i.test(text))
24
33
  return 'latexml';
@@ -26,26 +35,39 @@ export function detect(input) {
26
35
  return 'html';
27
36
  return;
28
37
  }
38
+ /** Markup the prolog may hold before the root, by how it opens and closes. */
39
+ const PROLOG_MARKUP = [
40
+ ['<!--', '-->'],
41
+ ['<?', '?>'],
42
+ ];
29
43
  /**
30
- * The text from the root element on, past an XML declaration and the comments and
31
- * whitespace before the root. Scanned forward once: a regex over a run of comments
32
- * backtracks exponentially when the root after them does not match.
44
+ * The text from the root element on, past the XML declaration, processing instructions,
45
+ * comments, and whitespace before the root. Scanned forward once: a regex over a run of
46
+ * comments backtracks exponentially when the root after them does not match.
33
47
  */
34
48
  function afterProlog(text) {
35
- let at = /^<\?xml[^>]*>/i.exec(text)?.[0].length ?? 0;
49
+ let at = 0;
36
50
  for (;;) {
37
51
  while (/\s/.test(text.charAt(at)))
38
52
  at++;
39
- if (!text.startsWith('<!--', at))
53
+ const markup = PROLOG_MARKUP.find(([open]) => text.startsWith(open, at));
54
+ if (!markup)
40
55
  return text.slice(at);
41
- const end = text.indexOf('-->', at + 4);
56
+ const [open, close] = markup;
57
+ const end = text.indexOf(close, at + open.length);
42
58
  if (end === -1)
43
59
  return '';
44
- at = end + 3;
60
+ at = end + close.length;
45
61
  }
46
62
  }
47
- /** Bytes as Latin-1 text: enough to sniff ASCII markup whatever the real encoding. */
48
- function latin1(bytes) {
49
- return new TextDecoder('latin1').decode(bytes);
63
+ /**
64
+ * The first {@link SNIFF_CHARS} characters of `bytes`, decoded by their byte-order mark as
65
+ * `decodeText` does — UTF-16 takes twice the bytes — else as Latin-1, which reads ASCII
66
+ * markup whatever the real encoding.
67
+ */
68
+ function opening(bytes) {
69
+ const encoding = bomEncoding(bytes);
70
+ const width = encoding === 'utf-16le' || encoding === 'utf-16be' ? 2 : 1;
71
+ return new TextDecoder(encoding ?? 'latin1').decode(bytes.subarray(0, SNIFF_CHARS * width));
50
72
  }
51
73
  //# sourceMappingURL=detect.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"detect.js","sourceRoot":"","sources":["../src/detect.ts"],"names":[],"mappings":"AAMA,2FAA2F;AAC3F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I,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;QAClD,IAAI,GAAG,KAAK,CAAC,CAAC;YAAE,OAAO,EAAE,CAAC;QAC1B,EAAE,GAAG,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC;IAC1B,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,SAAS,OAAO,CAAC,KAAiB;IAChC,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;IACpC,MAAM,KAAK,GAAG,QAAQ,KAAK,UAAU,IAAI,QAAQ,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACzE,OAAO,IAAI,WAAW,CAAC,QAAQ,IAAI,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,WAAW,GAAG,KAAK,CAAC,CAAC,CAAC;AAC9F,CAAC"}
@@ -16,7 +16,7 @@ export type FloatKind = 'figure' | 'table' | 'supplement';
16
16
  * `tw`, `supplementary`) together with the image, table, or file link they wrap, so a
17
17
  * class alone never swallows a section.
18
18
  */
19
- export declare function floatKind(element: Element): FloatKind | undefined;
19
+ export declare function floatKind(element: Element, ctx: HtmlContext): FloatKind | undefined;
20
20
  /** Blocks for a node list, in document order. */
21
21
  export declare function flowBlocks(nodes: Node[], ctx: HtmlContext): Block[];
22
22
  /** Link-list words publishers put in captions and reference entries, not part of the text. */
@@ -24,6 +24,7 @@ export declare const LINK_LABEL: RegExp;
24
24
  /**
25
25
  * True for an element that holds only links and link-list words ("Download: PNG TIFF",
26
26
  * "Full size image", "[DOI] [PubMed]"): navigation around a caption, not caption text.
27
+ * Text outside its links that runs past the subtree text cap is not a link list.
27
28
  */
28
- export declare function isLinkList(element: Element): boolean;
29
+ export declare function isLinkList(element: Element, ctx: HtmlContext): boolean;
29
30
  //# sourceMappingURL=blocks.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"blocks.d.ts","sourceRoot":"","sources":["../../../src/formats/html/blocks.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAYH,OAAO,KAAK,EACV,KAAK,EAKN,MAAM,yBAAyB,CAAC;AAKjC,OAAO,EAAE,KAAK,WAAW,EAA2B,MAAM,cAAc,CAAC;AAuCzE,mGAAmG;AACnG,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,YAAY,CAAC;AAY1D;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,CAyBjE;AAoED,iDAAiD;AACjD,wBAAgB,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,WAAW,GAAG,KAAK,EAAE,CAKnE;AAgID,8FAA8F;AAC9F,eAAO,MAAM,UAAU,QACid,CAAC;AAEze;;;GAGG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAUpD"}
1
+ {"version":3,"file":"blocks.d.ts","sourceRoot":"","sources":["../../../src/formats/html/blocks.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAaH,OAAO,KAAK,EACV,KAAK,EAKN,MAAM,yBAAyB,CAAC;AAKjC,OAAO,EAAE,KAAK,WAAW,EAA2B,MAAM,cAAc,CAAC;AAezE,mGAAmG;AACnG,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,YAAY,CAAC;AAY1D;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,WAAW,GAAG,SAAS,GAAG,SAAS,CAuBnF;AA0DD,iDAAiD;AACjD,wBAAgB,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,WAAW,GAAG,KAAK,EAAE,CAKnE;AAqJD,8FAA8F;AAC9F,eAAO,MAAM,UAAU,QACid,CAAC;AAEze;;;;GAIG;AACH,wBAAgB,UAAU,CA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