Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"rehype-raw": "^7.0.0",
"rehype-sanitize": "^6.0.0",
"remark-breaks": "^4.0.0",
"remark-cjk-friendly": "^2.3.1",
"remark-gfm": "^4.0.1",
"tailwind-merge": "^3.4.0",
"zustand": "^5.0.11"
Expand Down
14 changes: 14 additions & 0 deletions apps/web/src/components/ChatMarkdown.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,20 @@ describe("hasMarkdownFilePrimaryAction", () => {
});
});

describe("ChatMarkdown emphasis", () => {
it.each([false, true])(
"renders bold text ending in CJK punctuation with lineBreaks=%s",
(lineBreaks) => {
const html = renderToStaticMarkup(
<ChatMarkdown cwd="/tmp/project" text="**都没修。**Fetch" lineBreaks={lineBreaks} />,
);

expect(html).toContain("<strong>都没修。</strong>Fetch");
expect(html).not.toContain("**都没修。**");
},
);
});

describe("ChatMarkdown file option chips", () => {
it("keeps the fallback button text selectable", () => {
const html = renderToStaticMarkup(
Expand Down
3 changes: 3 additions & 0 deletions apps/web/src/components/ChatMarkdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ import rehypeSanitize, { defaultSchema } from "rehype-sanitize";
import remarkBreaks from "remark-breaks";
import { parseAssistantCitationHref } from "@t3tools/shared/assistantCitations";
import { AssistantCitationChip } from "./chat/AssistantCitationChip";
import remarkCjkFriendly from "remark-cjk-friendly";
import remarkGfm from "remark-gfm";
import { remarkGithubAlerts } from "../markdown-github-alerts";
import {
Expand Down Expand Up @@ -398,6 +399,7 @@ const CHAT_MARKDOWN_REMARK_PLUGINS = [
remarkGithubAlerts,
remarkNormalizeListItemIndentation,
remarkCodexDirectives,
remarkCjkFriendly,
remarkPreserveCodeMeta,
remarkNormalizeLinksAndTagInlineCode,
] satisfies NonNullable<ReactMarkdownOptions["remarkPlugins"]>;
Expand All @@ -407,6 +409,7 @@ const CHAT_MARKDOWN_REMARK_PLUGINS_WITH_BREAKS = [
remarkGithubAlerts,
remarkNormalizeListItemIndentation,
remarkCodexDirectives,
remarkCjkFriendly,
remarkBreaks,
remarkPreserveCodeMeta,
remarkNormalizeLinksAndTagInlineCode,
Expand Down
81 changes: 81 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading