diff --git a/packages/client-runtime/src/markdownLinks.test.ts b/packages/client-runtime/src/markdownLinks.test.ts index 42cd7a35e4732e445290f5536f65ad01fbe21cf5..4aea947b87d6e6df7d8515cfe59bac7a4e53d5c4 100644 --- a/packages/client-runtime/src/markdownLinks.test.ts +++ b/packages/client-runtime/src/markdownLinks.test.ts @@ -3,7 +3,6 @@ import { describe, expect, it } from "vite-plus/test"; import { fileBasename, inlineCodeFilePathCandidate, - isConventionalFilePosition, parseFileUrlHref, parseMarkdownFileLink, splitFilePathPosition, @@ -28,15 +27,6 @@ describe("inlineCodeFilePathCandidate", () => { }); }); -describe("isConventionalFilePosition", () => { - it("distinguishes extensionless file locations from labels and ports", () => { - expect(isConventionalFilePosition("Dockerfile:8:2")).toBe(true); - expect(isConventionalFilePosition("Makefile")).toBe(false); - expect(isConventionalFilePosition("TODO:12")).toBe(false); - expect(isConventionalFilePosition("port:3000")).toBe(false); - }); -}); - describe("parseFileUrlHref", () => { it.each([ ["file:///Users/julius/project/src/main.ts#L42", "/Users/julius/project/src/main.ts", "#L42"], diff --git a/packages/client-runtime/src/markdownLinks.ts b/packages/client-runtime/src/markdownLinks.ts index 2e455655d0050da93992bd5966f2f57289de63f1..29a337e49c424c02118b59d0f0a66410b1564c33 100644 --- a/packages/client-runtime/src/markdownLinks.ts +++ b/packages/client-runtime/src/markdownLinks.ts @@ -15,7 +15,6 @@ const INLINE_CODE_DISQUALIFIER_PATTERN = /[\s`]/; const PATH_SEPARATOR_PATTERN = /[\\/]/; const FILE_EXTENSION_PATTERN = /\.[A-Za-z0-9_-]+$/; const NUMERIC_DOTTED_PATTERN = /^\d+(?:\.\d+)+$/; -const BARE_EXTENSIONLESS_POSITION_PATTERN = /^[A-Za-z0-9_-]+(?::\d+){1,2}$/; // Standard OS and dev-container roots; deliberately excludes app-route-ish // prefixes like /app/ or /chat/ so SPA routes never read as files. const POSIX_FILE_ROOT_PREFIXES = [ @@ -152,14 +151,6 @@ function looksLikeHostname(segment: string, hasPosition: boolean): boolean { return !hasPosition && COUNTRY_HOSTNAME_TLDS.has(lastLabel); } -/** Recognizes conventional extensionless filenames with an explicit line position. */ -export function isConventionalFilePosition(path: string): boolean { - return ( - BARE_EXTENSIONLESS_POSITION_PATTERN.test(path) && - EXTENSIONLESS_FILE_NAMES.has(path.replace(POSITION_SUFFIX_PATTERN, "")) - ); -} - /** * Picks path-shaped inline code for the client's markdown file-link resolver. * It does not resolve paths or turn plain prose and fenced code into links.