Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Screenshot link provided in report opens to 'Resource not found' #377

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

PreethiMaai
Copy link
Contributor

No description provided.

@@ -102,7 +102,11 @@ attachScreenshotLinks = () => {
if (urlPattern.test(preHTML)) {
// Replace plain text URLs with clickable hyperlinks
const updatedHTML = preHTML.replace(urlPattern, (url) => {
return '<a href="' + url + '" target="_blank" rel="noopener noreferrer">' + url + '</a>';
let cleanedUrl = url;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend a different approach. I suggest modifying the regex on line 61 to be:

const urlPattern = /(https:\/\/[^\s]+\.jpg)/g; 

This ensures that only URLs ending with .jpg are matched, making the pattern more precise and aligned with the expected use case. If there is text added before the ] but after the URL, the current split(']')[0] approach will not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants