question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

how to add a relative link through addReporterContext in 2.3.0 +?

See original GitHub issue

Hello, i’ve been using this code in 2.0.0:

let partial = "testfiles/test1"; // <- this point to a system folder like /users/me/myproj/reports/mochawesomerun1/testfiles/test1

let mylink = '<a href=' + partial +  '>' + 'click to see inside test1 files' + '</a>';
addReporterContext(that, {
       title: "test folder (click the links to see contents)",
       value: mylink
});

which worked fine, however, after upgrading to 2.3.0, mochawesome now slaps extra set of double quotes around the HTML, and the link is not rendered.

Could you suggest a workaround for this case? For now i’ve downgraded back to 2.0.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
mingfangcommented, May 21, 2020

Being able to add relative links is critical for test reports. Please reopen this issue.

1reaction
adamgrubercommented, Jul 25, 2017

What was the behavior of your link? Did it open a browser window or a local folder on your desktop?

Passing HTML like that was a bit of a loophole, which was closed in 2.1.1 by removing dangerouslySetInnerHTML from the code snippet component. The component will no longer be able to render HTML that you pass. You can pass links as strings in your value prop but it expects links to use the http or ftp protocol. I don’t think there is any workaround since it was kind of a bug to begin with.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to create absolute hyperlinks and relative hyperlinks in ...
Describes how to create absolute and relative hyperlinks in Word 2003 ... By default, the Update links on save option in Web Options...
Read more >
How to link pages using relative URL in HTML? - Tutorialspoint
How to link pages using relative URL in HTML? - In HTML different HTML elements have attributes that contain link to the other...
Read more >
Knowledge Article - How to add relative link (url)... - ServiceNow
MVP and Rising Star nominations are open! submit your nomination(s) today thru December 31st. Nominate Now ...
Read more >
Timeout on Modal wait_for - Pycord-Development ... - IssueHint
Issue Title Created Date Comment Count Updated... Remove the prefix `QuickAdd:` from the command 0 2021‑10‑10 2022‑08... 3 icon requests (bollard / appear / pillar)...
Read more >
Relative links in an included html not working due to directory ...
html file and the header is included in all the files (using jquery). If I give a relative link in header.html as: <a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found