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: alert detail markdown link bug #3683

Merged
merged 4 commits into from
Feb 14, 2024
Merged

fix: alert detail markdown link bug #3683

merged 4 commits into from
Feb 14, 2024

Conversation

allending313
Copy link
Contributor

@allending313 allending313 commented Feb 14, 2024

  • Identified the issue which this PR solves.
  • Read the CONTRIBUTING document.
  • Code builds clean without any errors or warnings.
  • Added appropriate tests for any new functionality.
  • All new and existing tests passed.
  • Added comments in the code, where necessary.
  • Ran make check to catch common errors. Fixed any that came up.

Description:
User indicated that hyperlinks which should be rendered correctly via markdown were displayed as text. The issues seems to be that the <ReactMarkdown> component checks for safeUrls with url and label where url is rendered with html entities causing special characters such as & to be converted to &amp;. This messes with the accuracy of safeUrls regex checks resulting in false negatives thus causing ReactMarkdown to display the hyperlinks as plain text.

Adding preprocessing in the form of encodeHtmlEntities() ensures that the label/url comparisons are free of discrepancies caused by html entity conversions.

Which issue(s) this PR fixes:
[For significant amounts of work, it is best to start an issue first, preferably before the work is started.
For large pull requests, be sure to reference the associated GitHub issue(s).]
#3628

Describe any introduced user-facing changes:
Markdowns should properly render hyperlinks where the url and label match

@allending313 allending313 merged commit 41d45af into master Feb 14, 2024
7 checks passed
@allending313 allending313 deleted the fix-safeUrl-bug branch February 14, 2024 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ui: some markdown links in alert details generated as plain text
3 participants