Skip to content

Commit 71e75fc

Browse files
committed
fix: allow # in filenames for @file references (upstream anomalyco#12424)
1 parent c74c045 commit 71e75fc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/opencode/src/config/markdown.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import matter from "gray-matter"
33
import { z } from "zod"
44

55
export namespace ConfigMarkdown {
6-
export const FILE_REGEX = /(?<![\w`])@(\.?[^\s`,.#]*(?:\.[^\s`,.#]+)*)(?:#L(\d+)(?:-(\d+))?)?/g
6+
export const FILE_REGEX =
7+
/(?<![\w`])@(\.?(?:[^\s`,.#]|#(?!L\d))*(?:\.(?:[^\s`,.#]|#(?!L\d))+)*)(?:#L(\d+)(?:-(\d+))?)?/g
78
export const SHELL_REGEX = /!`([^`]+)`/g
89

910
export function files(template: string) {

0 commit comments

Comments
 (0)