mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-05 15:31:27 +00:00
Fix Markdown table cell separator escaping in MarkdownDisplay.tsx
This commit is contained in:
parent
4c0e4a9611
commit
0853cef7c0
1 changed files with 2 additions and 2 deletions
|
|
@ -111,7 +111,7 @@ const MarkdownDisplayInternal: React.FC<MarkdownDisplayProps> = ({
|
|||
lines[index + 1].match(tableSeparatorRegex)
|
||||
) {
|
||||
inTable = true;
|
||||
tableHeaders = tableRowMatch[1].split('|').map((cell) => cell.trim());
|
||||
tableHeaders = tableRowMatch[1].split(/(?<!\\)\|/).map((cell) => cell.trim().replaceAll('\\|', '|'));
|
||||
tableRows = [];
|
||||
} else {
|
||||
// Not a table, treat as regular text
|
||||
|
|
@ -127,7 +127,7 @@ const MarkdownDisplayInternal: React.FC<MarkdownDisplayProps> = ({
|
|||
// Skip separator line - already handled
|
||||
} else if (inTable && tableRowMatch) {
|
||||
// Add table row
|
||||
const cells = tableRowMatch[1].split('|').map((cell) => cell.trim());
|
||||
const cells = tableRowMatch[1].split(/(?<!\\)\|/).map((cell) => cell.trim().replaceAll('\\|', '|'));
|
||||
// Ensure row has same column count as headers
|
||||
while (cells.length < tableHeaders.length) {
|
||||
cells.push('');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue