GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(shared): inline code with a <placeholder> path segment stays plai… · patroza/t3code@a03617a

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/shared/src
    • markdownLinks.test.ts
    • markdownLinks.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/shared/src/markdownLinks.test.ts‎

Copy file name to clipboardExpand all lines: packages/shared/src/markdownLinks.test.ts
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ describe("inlineCodeFilePathCandidate", () => {
6363
["/bin/echo hello world.txt", null],
6464
["~/bin/run tests.sh", null],
6565
["/Users/me/notes with spaces.md", "/Users/me/notes with spaces.md"],
66+
["~/Videos/clips/<thread-slug>/shot.png", null],
67+
["clips/<name>.mp4", null],
6668
])("distinguishes file paths from code and hostnames in %s", (source, candidate) => {
6769
expect(inlineCodeFilePathCandidate(source)).toBe(candidate);
6870
});
Collapse file

‎packages/shared/src/markdownLinks.ts‎

Copy file name to clipboardExpand all lines: packages/shared/src/markdownLinks.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ function looksLikeHostname(segment: string, hasPosition: boolean): boolean {
201201

202202
export function inlineCodeFilePathCandidate(codeText: string): string | null {
203203
const trimmed = codeText.trim();
204-
if (trimmed.length === 0 || trimmed.includes("`")) return null;
204+
if (trimmed.length === 0 || trimmed.includes("`") || /[<>]/.test(trimmed)) return null;
205205
if (INLINE_CODE_WHITESPACE_PATTERN.test(trimmed) && !isSpacedAbsoluteFilePath(trimmed)) {
206206
return null;
207207
}

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.