GeezerVison is showing github.com — Revert "fix: strip parentheses from file paths generated by llm" · prashanthpai/opencode@f0ed1e3
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: .opencode/bun.lock +3-3Lines changed: 3 additions & 3 deletions Collapse file
Copy file name to clipboard +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | { |
2 | 2 | "dependencies": { |
3 | 3 | "@octokit/rest": "^22.0.1", |
4 | | - "@opencode-ai/plugin": "1.0.162" |
| 4 | + "@opencode-ai/plugin": "0.0.0-dev-202512160508" |
5 | 5 | } |
6 | 6 | } |
Collapse file
Copy file name to clipboardExpand all lines: packages/ui/src/components/markdown.tsx +1-7Lines changed: 1 addition & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -7,12 +7,6 @@ function strip(text: string): string { |
7 | 7 | return match ? match[2] : text |
8 | 8 | } |
9 | 9 |
|
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 | | - |
16 | 10 | export function Markdown( |
17 | 11 | props: ComponentProps<"div"> & { |
18 | 12 | text: string |
@@ -23,7 +17,7 @@ export function Markdown( |
23 | 17 | const [local, others] = splitProps(props, ["text", "class", "classList"]) |
24 | 18 | const marked = useMarked() |
25 | 19 | const [html] = createResource( |
26 | | - () => removeParensAroundFileRefs(strip(local.text)), |
| 20 | + () => strip(local.text), |
27 | 21 | async (markdown) => { |
28 | 22 | return marked.parse(markdown) |
29 | 23 | }, |
|
Collapse file
Copy file name to clipboardExpand all lines: packages/web/src/components/share/content-markdown.tsx +1-7Lines changed: 1 addition & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -29,7 +29,7 @@ interface Props { |
29 | 29 | } |
30 | 30 | export function ContentMarkdown(props: Props) { |
31 | 31 | const [html] = createResource( |
32 | | - () => removeParensAroundFileRefs(strip(props.text)), |
| 32 | + () => strip(props.text), |
33 | 33 | async (markdown) => { |
34 | 34 | return markedWithShiki.parse(markdown) |
35 | 35 | }, |
@@ -65,9 +65,3 @@ function strip(text: string): string { |
65 | 65 | const match = text.match(wrappedRe) |
66 | 66 | return match ? match[2] : text |
67 | 67 | } |
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 | | -} |