Skip to content

Chat view: URLs followed by periods incorrectly include period in clickable link #4705

@hannesrudolph

Description

@hannesrudolph

App Version

Version: 3.20.3

API Provider

OpenRouter

Model Used

Sonnet 4.0

🔁 Steps to Reproduce

  1. Create a new chat in Code mode
  2. Type the following message: repeat back to me a summary with a link https://github.com/RooCodeInc/Roo-Code/issues/4704 in a sentence with a period at the end. made up summary
  3. Wait for Roo to generate a response with the URL in a sentence ending with a period
  4. Click the generated link in Roo's summary
  5. Observe that the link incorrectly includes the trailing period

💥 Outcome Summary

Expected: URL should be clickable without the trailing period (linking to https://github.com/RooCodeInc/Roo-Code/issues/4704)

Actual: The clickable link incorrectly includes the trailing period (linking to https://github.com/RooCodeInc/Roo-Code/issues/4704.)

📄 Relevant Logs or Errors

No error logs - this is a URL parsing issue in the frontend.

Technical Context

Based on codebase investigation:

  • The issue is in webview-ui/src/components/common/MarkdownBlock.tsx:28
  • The remarkUrlToLink plugin uses regex /https?:\/\/[^\s<>)"]+/g to detect URLs
  • This regex excludes whitespace, <, >, ), and " but does not exclude periods
  • When a URL appears at the end of a sentence with a period, the period gets included in the match
  • The regex captures everything up to whitespace or the excluded characters, so periods become part of the link

Root cause: The URL detection regex pattern needs to be refined to handle trailing punctuation properly.

Suggested fix: Update the regex to exclude trailing periods (and potentially other sentence-ending punctuation) from URL matches.

Image

Metadata

Metadata

Assignees

Labels

Issue - In ProgressSomeone is actively working on this. Should link to a PR soon.bugSomething isn't workingchatfrontend

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions