diff --git a/apps/web/src/components/chat/MathTypeset.tsx b/apps/web/src/components/chat/MathTypeset.tsx
index e684685e349f4..e70b9787e2161 100644
--- a/apps/web/src/components/chat/MathTypeset.tsx
+++ b/apps/web/src/components/chat/MathTypeset.tsx
@@ -26,26 +26,12 @@ function typeset(tex: string, display: boolean): string {
};
let html = "";
try {
-<<<<<<< origin/main
- html = katex.renderToString(tex, {
- displayMode: display,
- output: "htmlAndMathml",
- throwOnError: true,
- // No \href, \url, \htmlClass, or other commands that emit active HTML.
- trust: false,
- strict: "ignore",
- maxSize: 20,
- maxExpand: 1000,
- macros: mathMacros(),
- });
-=======
- html = katex.renderToString(tex, options);
->>>>>>> upstream/main
+ html = katex.renderToString(tex, { ...options, macros: mathMacros() });
} catch {
const repaired = escapeLiteralPercents(tex);
if (repaired !== tex) {
try {
- html = katex.renderToString(repaired, options);
+ html = katex.renderToString(repaired, { ...options, macros: mathMacros() });
} catch {
// Unfinished or unsupported TeX stays readable as its source.
}
diff --git a/apps/web/src/components/chat/MessagesTimeline.browser.test.tsx b/apps/web/src/components/chat/MessagesTimeline.browser.test.tsx
index 8ac12b54a4e50..3e6dddf967d68 100644
--- a/apps/web/src/components/chat/MessagesTimeline.browser.test.tsx
+++ b/apps/web/src/components/chat/MessagesTimeline.browser.test.tsx
@@ -865,7 +865,7 @@ describe("MessagesTimeline messages", () => {
expect((globalThis as { __t3Xss?: number }).__t3Xss).toBeUndefined();
});
- it("keeps single tildes in user paths literal without changing double tildes or assistant text", async () => {
+ it("keeps single tildes in user and assistant paths literal without changing double tildes", async () => {
const source =
"Install the skill as ~/folder-a/skills/x, then follow the guide (~/folder-a/guide.md).";
await using screen = await renderTimeline([
@@ -879,9 +879,8 @@ describe("MessagesTimeline messages", () => {
expect(user?.textContent).toContain(source);
expect(user?.querySelector("del")).toBeNull();
expect(doubleTilde?.querySelector("del")?.textContent).toBe("the old plan");
- expect(assistant?.querySelector("del")?.textContent).toBe(
- "/folder-a/skills/x, then follow the guide (",
- );
+ // Fork: agent text keeps single tildes too.
+ expect(assistant?.querySelector("del")).toBeNull();
});
it("renders sanitized raw HTML in assistant messages", async () => {
diff --git a/apps/web/src/components/chat/ProposedPlanCard.tsx b/apps/web/src/components/chat/ProposedPlanCard.tsx
index b1136741f4687..156953ef56027 100644
--- a/apps/web/src/components/chat/ProposedPlanCard.tsx
+++ b/apps/web/src/components/chat/ProposedPlanCard.tsx
@@ -202,7 +202,7 @@ export const ProposedPlanCard = memo(function ProposedPlanCard({
threadRef={threadRef}
isStreaming={false}
headingLevelOffset={3}
- // Fork: selects upstream's single-tilde list, so a plan's "1~2" keeps its tilde.
+ // Fork: selects the agent-text single-tilde list, so a plan's "1~2" keeps its tilde.
assistantReply
/>
) : (
@@ -213,7 +213,7 @@ export const ProposedPlanCard = memo(function ProposedPlanCard({
threadRef={threadRef}
isStreaming={false}
headingLevelOffset={3}
- // Fork: selects upstream's single-tilde list, so a plan's "1~2" keeps its tilde.
+ // Fork: selects the agent-text single-tilde list, so a plan's "1~2" keeps its tilde.
assistantReply
/>
)}
diff --git a/apps/web/src/components/chat/TimelineAssistantRows.tsx b/apps/web/src/components/chat/TimelineAssistantRows.tsx
index c2e7c7d0ee8e2..71357d8f6f962 100644
--- a/apps/web/src/components/chat/TimelineAssistantRows.tsx
+++ b/apps/web/src/components/chat/TimelineAssistantRows.tsx
@@ -57,11 +57,8 @@ export function AssistantTimelineRow({ row }: { row: Extract
>>>>>> upstream/main
cwd={ctx.markdownCwd}
threadRef={ctx.threadRef ?? undefined}
isStreaming={Boolean(row.message.streaming)}
@@ -82,15 +79,12 @@ export function AssistantTimelineRow({ row }: { row: Extract
) : null}
-<<<<<<< origin/main
-=======
{!row.showAssistantMeta && row.projectedItem?.item.status === "interrupted" ? (
) : null}
->>>>>>> upstream/main
{row.showAssistantMeta ? (
))}
@@ -480,7 +480,7 @@ function WorkEntryLogRow(props: WorkEntryRowProps) {
)}
cwd={ctx.markdownCwd}
parseRawHtml={false}
- // Fork: selects upstream's single-tilde list, so a thinking line's "1~2" keeps its tilde.
+ // Fork: selects the agent-text single-tilde list, so a thinking line's "1~2" keeps its tilde.
assistantReply
extraRemarkPlugins={
workEntry.toolLifecycleStatus === "inProgress"
diff --git a/apps/web/src/components/chat/TimelineWorkGroupRows.tsx b/apps/web/src/components/chat/TimelineWorkGroupRows.tsx
index dd4ce97dd34bd..de903a78ce1f1 100644
--- a/apps/web/src/components/chat/TimelineWorkGroupRows.tsx
+++ b/apps/web/src/components/chat/TimelineWorkGroupRows.tsx
@@ -615,7 +615,7 @@ export function LiveWorkEntryTimelineRow({
text={thoughtLine}
cwd={ctx.markdownCwd}
parseRawHtml={false}
- // Fork: selects upstream's single-tilde list, so a thinking line's "1~2" keeps its tilde.
+ // Fork: selects the agent-text single-tilde list, so a thinking line's "1~2" keeps its tilde.
assistantReply
extraRemarkPlugins={THOUGHT_PREVIEW_PLUGINS}
/>
@@ -638,7 +638,7 @@ export function LiveWorkEntryTimelineRow({
text={(row.entry.detail ?? label).slice(0, THOUGHT_PREVIEW_SOURCE_MAX_LENGTH)}
cwd={ctx.markdownCwd}
parseRawHtml={false}
- // Fork: selects upstream's single-tilde list, so a thinking line's "1~2" keeps its tilde.
+ // Fork: selects the agent-text single-tilde list, so a thinking line's "1~2" keeps its tilde.
assistantReply
extraRemarkPlugins={row.active ? THINKING_PREVIEW_PLUGINS : THOUGHT_PREVIEW_PLUGINS}
/>
diff --git a/apps/web/src/components/chat/UserMessageContextChips.tsx b/apps/web/src/components/chat/UserMessageContextChips.tsx
index 390d35dfdc9e2..ef258d2c890a2 100644
--- a/apps/web/src/components/chat/UserMessageContextChips.tsx
+++ b/apps/web/src/components/chat/UserMessageContextChips.tsx
@@ -1,5 +1,6 @@
import { documentChipKindForFileName } from "~/pierre-icons";
import { isSvgAttachment } from "@t3tools/shared/image";
+import { CHAT_USER_MARKDOWN_REMARK_PLUGINS } from "@t3tools/shared/markdownPipeline";
import { useRenderedAppearance } from "../../hooks/useTheme";
import { PullRequestGlyph } from "../pullRequest/pullRequestIcons";
import { ReadOnlySourcePreview } from "../files/AttachmentFilePreview";
@@ -580,8 +581,8 @@ function UserMessageReviewCommentCard({ comment }: { comment: ReviewCommentConte
skills={ctx.skills}
parseRawHtml={false}
lineBreaks
- // Fork: selects upstream's single-tilde list, so a sent "1~2" keeps its tilde.
- assistantReply
+ // Fork: a sent "1~2" keeps its tilde, as in the user's message.
+ extraRemarkPlugins={CHAT_USER_MARKDOWN_REMARK_PLUGINS}
/>
)}
diff --git a/apps/web/src/components/composerContextPresentation.tsx b/apps/web/src/components/composerContextPresentation.tsx
index 2fa0fdacff149..185a29ec5183d 100644
--- a/apps/web/src/components/composerContextPresentation.tsx
+++ b/apps/web/src/components/composerContextPresentation.tsx
@@ -1,5 +1,6 @@
import ChatMarkdown from "./ChatMarkdown";
import { isSvgAttachment } from "@t3tools/shared/image";
+import { CHAT_USER_MARKDOWN_REMARK_PLUGINS } from "@t3tools/shared/markdownPipeline";
import { ReadOnlySourcePreview } from "./files/AttachmentFilePreview";
import type {
EnvironmentContextRecord,
@@ -298,8 +299,8 @@ function ComposerReviewCommentDetails({ comment }: { comment: ReviewCommentConte