GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(server): EPUB attachments keep their table captions for agents (#… · patroza/t3code@487a29b

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • apps/server/src/provider
    • documentTextWorker.ts
    • userInputAttachments.test.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎apps/server/src/provider/documentTextWorker.ts‎

Copy file name to clipboardExpand all lines: apps/server/src/provider/documentTextWorker.ts
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,14 @@ function hasCellText(cell: XmlNode): boolean {
355355
);
356356
}
357357
function* table(node: XmlNode): Generator<TextPart, void> {
358+
for (const caption of children(node)) {
359+
if (caption.name !== "caption") continue;
360+
yield LINE_START;
361+
yield* paragraphs(caption);
362+
yield LINE_START;
363+
}
358364
let rowCount = 0;
359-
for (const row of all(node, ["tr", "table-row"])) {
365+
for (const row of all(node, ["tr", "table-row"], ["caption"])) {
360366
// Word nests a cell inside w:sdt when a content control wraps the whole cell.
361367
const cells = [...all(row, ["tc", "table-cell", "covered-table-cell", "td", "th"])];
362368
// ODS writers pad sheets with repeated empty rows and trailing cells.
Collapse file

‎apps/server/src/provider/userInputAttachments.test.ts‎

Copy file name to clipboardExpand all lines: apps/server/src/provider/userInputAttachments.test.ts
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1514,7 +1514,7 @@ describe("question answer paths", () => {
15141514
"OEBPS/book.opf":
15151515
'<package><manifest><item id="a" href="a.xhtml"/><item id="b" href="b.xhtml"/><item id="c" href="c.xhtml"/></manifest><spine><itemref idref="b"/><itemref idref="a" hidden=""/><itemref idref="c"/></spine></package>',
15161516
"OEBPS/a.xhtml":
1517-
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html><body><p>Last chapter</p><p>Price <s>10</s> 8 <del>old</del></p><p><ruby>山路<rt>やまみち</rt></ruby>を歩く。<ruby>東京<rp>(</rp><script type="application/json">{}</script><rt>とうきょう</rt><script type="application/json">{}</script><rp>)</rp></ruby>に着く。<ruby>川<rt/></ruby>を見る。<ruby>海<rp/><rt>うみ</rt><rp> </rp></ruby>まで。</p></body></html>',
1517+
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html><body><p>Last chapter</p><div>Totals<table><caption>Table 1: Revenue</caption><tr><th>Q1</th><th>Q2</th></tr><tr><td>100</td><td>200</td></tr></table></div><table><caption><p>Table 2: Costs</p></caption><tr><td>Rent</td></tr></table><p>Price <s>10</s> 8 <del>old</del></p><p><ruby>山路<rt>やまみち</rt></ruby>を歩く。<ruby>東京<rp>(</rp><script type="application/json">{}</script><rt>とうきょう</rt><script type="application/json">{}</script><rp>)</rp></ruby>に着く。<ruby>川<rt/></ruby>を見る。<ruby>海<rp/><rt>うみ</rt><rp> </rp></ruby>まで。</p></body></html>',
15181518
"OEBPS/b.xhtml":
15191519
'<!DOCTYPE html><html><head><title>My Novel</title><meta name="author" content="Hidden Author"/></head><body><h1>First chapter</h1><p>Larkspur</p><p>Map: <img src="map.png" alt="North &amp; south piers"/> open<img src="blank.png" alt=""/><img src="missing.png"/>.</p><div><img src="cover.png" alt="Cover art"/></div><img hidden="" src="draft.png" alt="Hidden image text"/><img src="none.png" alt="Display none image" style="width: 1em; DISPLAY: none"/><img src="invisible.png" alt="Invisible image" style="visibility:hidden !important"/><div>Direct div<section>Direct section<li>Direct item <em>emphasis</em> trailing</li></section></div><div>Account: A<br/>Balance: 731<line-break/>Currency: USD</div><table><thead><tr><th>Heading</th><th>Total</th></tr></thead><tbody><tr><td>Important value</td><td>731</td></tr><tr><td>Before<table><tr><td>Inner</td></tr></table>After</td><td>Neighbor</td></tr></tbody></table><dl><dt>Port</dt><dd>443</dd><dt>Timeout</dt><dd>30 seconds</dd></dl><p hidden="">Draft note</p><div hidden="hidden">Hidden block<p>Hidden nested</p></div><p hidden="UNTIL-FOUND">Findable note</p><p aria-hidden="true">Decorative note</p><p x:hidden="true">Prefixed note</p><ol><li>Before boarding<ul><li>Check passports<ol><li>Compare names</li></ol></li><li>Confirm gate</li></ul></li><li>Board promptly</li><li><p>Before landing</p><ul><li>Collect bags</li></ul></li></ol>' +
15201520
"<ol><li>Indented\n <ul><li>Alpha</li></ul></li></ol></body></html>",
@@ -1540,6 +1540,8 @@ describe("question answer paths", () => {
15401540
"Indented\n Alpha",
15411541
"## Chapter 2",
15421542
"Last chapter",
1543+
"Totals\nTable 1: Revenue\nQ1\tQ2\n100\t200",
1544+
"Table 2: Costs\nRent",
15431545
"Price 10 8 old",
15441546
"山路(やまみち)を歩く。東京(とうきょう)に着く。川を見る。海(うみ) まで。",
15451547
"## Chapter 3",

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.