Skip to content

Commit b064503

Browse files
committed
docs(rich-md-editor): note why table cells escape only pipes (renderChildren pre-escapes backslashes)
1 parent feb7861 commit b064503

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor

apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/extensions.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ const PipeSafeTable = Table.extend({
4242
renderMarkdown: (node: JSONContent, h: MarkdownRendererHelpers) =>
4343
renderTableToMarkdown(node, {
4444
...h,
45+
// `renderChildren` already markdown-escapes backslashes; here we only add the table-specific
46+
// pipe escaping on top. (CodeQL flags the missing backslash escape, but escaping it again would
47+
// double-escape and break round-trip idempotency — see the table round-trip tests.)
4548
renderChildren: (nodes, separator) =>
4649
h.renderChildren(nodes, separator).replace(/\|/g, '\\|'),
4750
})

0 commit comments

Comments
 (0)