fix-click-chat-messege - #305
Open
Sayan-pixel wants to merge 2 commits into
Open
Conversation
Sayan-pixel
requested review from
DenizAltunkapan and
GabrielBBaldez
as code owners
July 30, 2026 17:21
Member
|
@Sayan-pixel please fix the failing workflows |
- Replace {{ msg.content }} interpolation with [innerHTML] binding
- Add formatMessage() that detects URLs and wraps them in <a> tags
- Escape all text segments with escapeHtml() to prevent XSS
- Escape URLs in href attribute to prevent attribute breakout
- Strip trailing punctuation (.,;:!?) from matched URLs
- Sanitise assembled HTML with DOMPurify (ADD_ATTR: ['target'])
- Set target=_blank and rel='noopener noreferrer' on generated links
- Add scoped ::ng-deep styles for links inside chat bubbles
- Add 8 unit tests covering linkification, XSS, edge cases
Closes #<issue-number>
Sayan-pixel
force-pushed
the
fix-clickable-urls
branch
from
July 31, 2026 18:15
5200a18 to
747fc73
Compare
Author
SummaryURLs sent in chat messages are now rendered as clickable links that open in a new tab. Only ProblemThe message bubble rendered decrypted content using Angular interpolation ( Solution
Layer | Change
-- | --
Template | Replaced {{ msg.content }} with [innerHTML]="formatMessage(msg.content)"
Detection | formatMessage() uses a regex to find http:// and https:// URLs in the decrypted text
Link generation | Each URL is wrapped in
Escaping | Every text segment is HTML-escaped via escapeHtml(); the URL is escaped in both href and display text
Sanitisation | The assembled HTML is sanitised with DOMPurify (same library used by the cloud page's Markdown preview)
Trailing punctuation | Trailing .,;:!?) is stripped from matched URLs so "visit https://example.com." links correctly
Styling | Scoped ::ng-deep CSS makes links underlined and inherit the bubble's text color
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implemented support for clickable URLs in chat messages.
http://andhttps://URLs in decrypted chat messages.target="_blank".rel="noopener noreferrer"for improved security.Linked issue
Closes #302
How to test
Hello Worldhttps://google.comVisit https://github.com/Vault-Webhttps://google.com https://openai.comftp://example.com<script>alert(1)</script>http://andhttps://URLs are clickable.Notes / Risk