From bb782e00cc4e4ee67d8903cbf44c8706d98ed000 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Sat, 5 Sep 2026 15:14:34 -0700 Subject: [PATCH] docs: explain collision-free Markdown prefix length --- mobile/src/components/mobile-markdown-preview-html.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/mobile/src/components/mobile-markdown-preview-html.ts b/mobile/src/components/mobile-markdown-preview-html.ts index b9baf4c2c5f..a5866b171e6 100644 --- a/mobile/src/components/mobile-markdown-preview-html.ts +++ b/mobile/src/components/mobile-markdown-preview-html.ts @@ -212,6 +212,7 @@ function codePlaceholderPrefix(content: string): string { while (content[cursor] === '_') { cursor += 1 } + // One extra underscore keeps the prefix longer than every authored run. suffixLength = Math.max(suffixLength, cursor - suffixStart + 1) } return CODE_PLACEHOLDER_PREFIX_BASE + '_'.repeat(suffixLength)