diff options
| author | David Hill <[email protected]> | 2025-12-16 12:12:01 +0000 |
|---|---|---|
| committer | David Hill <[email protected]> | 2025-12-16 12:12:01 +0000 |
| commit | f0ed1e38c96d39f53be57f1710f21e1fef9fdfa9 (patch) | |
| tree | f94d88f8294b3b5e11ed61d53e0d8e0c6f908b58 /packages/web/src | |
| parent | ac0f1dbbdddde76e8b40c6e4895302f870648bf2 (diff) | |
| download | opencode-f0ed1e38c96d39f53be57f1710f21e1fef9fdfa9.tar.gz opencode-f0ed1e38c96d39f53be57f1710f21e1fef9fdfa9.zip | |
Revert "fix: strip parentheses from file paths generated by llm"
This reverts commit 6c1a1a77b762dbde875f0325ca43903c2c0840b6.
Diffstat (limited to 'packages/web/src')
| -rw-r--r-- | packages/web/src/components/share/content-markdown.tsx | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/packages/web/src/components/share/content-markdown.tsx b/packages/web/src/components/share/content-markdown.tsx index db3f4a516..69cde82b2 100644 --- a/packages/web/src/components/share/content-markdown.tsx +++ b/packages/web/src/components/share/content-markdown.tsx @@ -29,7 +29,7 @@ interface Props { } export function ContentMarkdown(props: Props) { const [html] = createResource( - () => removeParensAroundFileRefs(strip(props.text)), + () => strip(props.text), async (markdown) => { return markedWithShiki.parse(markdown) }, @@ -65,9 +65,3 @@ function strip(text: string): string { const match = text.match(wrappedRe) return match ? match[2] : text } - -function removeParensAroundFileRefs(text: string): string { - // Remove parentheses around inline code that looks like a file reference - // Matches: (`path/to/file.ext`) or (`path/to/file.ext:1-10`) or (`file.ext:42`) - return text.replace(/\(\s*(`[^`]+\.[a-zA-Z0-9]+(?::\d+(?:-\d+)?)?`)\s*\)/g, "$1") -} |
