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(web): RTF previews no longer join text across section and column breaks by Michel-Liao · Pull Request #40437 · pingdotgg/t3code

fix(web): RTF previews no longer join text across section and column breaks #40437

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
juliusmarminge merged 2 commits into pingdotgg:main from Michel-Liao:fix/web-rtf-section-column-breaks
Nov 21, 2026

Uh oh!

There was an error while loading. Please reload this page.

Merged

fix(web): RTF previews no longer join text across section and column breaks #40437

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit Hold shift + click to select a range
4b2782e
fix(web): RTF previews no longer join text across section and column …
Michel-Liao Nov 21, 2026
79d4c8c
Merge remote-tracking branch 'origin/main' into fix/web-rtf-section-c…
juliusmarminge Nov 21, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view
Next Next commit
fix(web): RTF previews no longer join text across section and column …
…breaks

The Files preview of an RTF document broke the line at \par, \line and
\row but ignored \sect and \column, so the text on either side of a bare
section or column break ran together on one line. The server's text
extractor for the same file already breaks at both (#38598), so the
preview disagreed with what the agent reads.

The preview now starts a new line at \sect and \column unless one has
just started. Writers usually end the paragraph before these breaks
(\par\sect), and those documents render as before.

Claude Fable 5.2 in Claude Code, running in T3 Code.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
  • Loading branch information

Uh oh!

There was an error while loading. Please reload this page.

@Michel-Liao @claude
Michel-Liao and claude committed Nov 21, 2026
commit 4b2782ecf4ca6ba3e933ca057de36f47b6ec7c3d

There are no files selected for viewing

21 changes: 21 additions & 0 deletions 21 apps/web/src/components/files/FilePreviewPanel.test.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,27 @@ Third}`;
);
});

it("starts a new line at rich text section and column breaks", () => {
const result = openRtf(
bytes(
String.raw`{\rtf1\ansi\sectd\cols2\pard North quota: 120\column South quota: 240\page East quota: 360\sect\sectd\pard West quota: 480\par}`,
),
);
if (result.type !== "document") throw new Error("Expected document");
expect(result.pages.map((page) => page.html)).toEqual([
"<p>North quota: 120<br>South quota: 240</p>",
"<p>East quota: 360<br>West quota: 480<br></p>",
]);
const written = openRtf(
bytes(String.raw`{\rtf1\ansi First\par\sect\sectd Second\par\column Third\page\sect Fourth}`),
);
if (written.type !== "document") throw new Error("Expected document");
expect(written.pages.map((page) => page.html)).toEqual([
"<p>First<br>Second<br>Third</p>",
"<p>Fourth</p>",
]);
});

it("decodes declared rich text code pages for raw bytes and escaped byte runs", () => {
const input = new TextEncoder().encode(
String.raw`{\rtf1\ansi\ansicpg1251 A \'c0\par\ansicpg932\'82\'a0}`,
Expand Down
5 changes: 4 additions & 1 deletion 5 apps/web/src/components/files/extendedDocumentPreview.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,10 @@ export function openRtf(bytes: ArrayBuffer): OfficeWorkerResult {
(!hidden() && (word === "par" || word === "line"))
)
html += "<br>";
else {
// Writers usually end the paragraph before these breaks; a second break would add a blank line.
else if (!hidden() && (word === "sect" || word === "column")) {
if (html && !html.endsWith("<br>")) html += "<br>";
} else {
const character = RTF_CHARACTERS.get(word!);
if (character) emit(character);
}
Expand Down
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
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.