Skip to content

Commit f0ed1e3

Browse files
committed
Revert "fix: strip parentheses from file paths generated by llm"
This reverts commit 6c1a1a7.
1 parent ac0f1db commit f0ed1e3

4 files changed

Lines changed: 6 additions & 18 deletions

File tree

.opencode/bun.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.opencode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"dependencies": {
33
"@octokit/rest": "^22.0.1",
4-
"@opencode-ai/plugin": "1.0.162"
4+
"@opencode-ai/plugin": "0.0.0-dev-202512160508"
55
}
66
}

packages/ui/src/components/markdown.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@ function strip(text: string): string {
77
return match ? match[2] : text
88
}
99

10-
function removeParensAroundFileRefs(text: string): string {
11-
// Remove parentheses around inline code that looks like a file reference
12-
// Matches: (`path/to/file.ext`) or (`path/to/file.ext:1-10`) or (`file.ext:42`)
13-
return text.replace(/\(\s*(`[^`]+\.[a-zA-Z0-9]+(?::\d+(?:-\d+)?)?`)\s*\)/g, "$1")
14-
}
15-
1610
export function Markdown(
1711
props: ComponentProps<"div"> & {
1812
text: string
@@ -23,7 +17,7 @@ export function Markdown(
2317
const [local, others] = splitProps(props, ["text", "class", "classList"])
2418
const marked = useMarked()
2519
const [html] = createResource(
26-
() => removeParensAroundFileRefs(strip(local.text)),
20+
() => strip(local.text),
2721
async (markdown) => {
2822
return marked.parse(markdown)
2923
},

packages/web/src/components/share/content-markdown.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ interface Props {
2929
}
3030
export function ContentMarkdown(props: Props) {
3131
const [html] = createResource(
32-
() => removeParensAroundFileRefs(strip(props.text)),
32+
() => strip(props.text),
3333
async (markdown) => {
3434
return markedWithShiki.parse(markdown)
3535
},
@@ -65,9 +65,3 @@ function strip(text: string): string {
6565
const match = text.match(wrappedRe)
6666
return match ? match[2] : text
6767
}
68-
69-
function removeParensAroundFileRefs(text: string): string {
70-
// Remove parentheses around inline code that looks like a file reference
71-
// Matches: (`path/to/file.ext`) or (`path/to/file.ext:1-10`) or (`file.ext:42`)
72-
return text.replace(/\(\s*(`[^`]+\.[a-zA-Z0-9]+(?::\d+(?:-\d+)?)?`)\s*\)/g, "$1")
73-
}

0 commit comments

Comments
 (0)