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

Linkify raw links in HTML message contents #1102

Merged
merged 4 commits into from
Aug 21, 2023

Conversation

jmartinesp
Copy link
Member

@jmartinesp jmartinesp commented Aug 21, 2023

Changes

  • Creates a ClickableLinkText for String.
  • Adds a linkify parameter to the original function, which is true by default.
  • Does the linkify logic inside that component, if linkify is true.
  • Makes sure we don't linkify urls that are already inside url annotations or domains that are parts of user mentions or room aliases.

Why

Fixes #1079.

Screenshots

Before After

- Creates a `ClickableLinkText` for `String`.
- Adds a `linkify` parameter to the original function, which is `true` by default.
- Does the linkify logic inside that component, if `linkify` is true.
@jmartinesp jmartinesp requested a review from a team as a code owner August 21, 2023 10:59
@jmartinesp jmartinesp requested review from bmarty and removed request for a team August 21, 2023 10:59
@jmartinesp jmartinesp changed the title Linkify links in HTML too: Linkify raw links in HTML message contents Aug 21, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Aug 21, 2023

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/H8TDyV

@codecov
Copy link

codecov bot commented Aug 21, 2023

Codecov Report

Patch coverage: 57.40% and no project coverage change.

Comparison is base (cc38293) 57.09% compared to head (9f43239) 57.10%.
Report is 1 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1102   +/-   ##
========================================
  Coverage    57.09%   57.10%           
========================================
  Files         1019     1019           
  Lines        25894    25917   +23     
  Branches      5192     5203   +11     
========================================
+ Hits         14785    14800   +15     
- Misses        8835     8837    +2     
- Partials      2274     2280    +6     
Files Changed Coverage Δ
...aries/designsystem/components/ClickableLinkText.kt 41.75% <53.06%> (+13.49%) ⬆️
.../timeline/components/event/TimelineItemTextView.kt 71.42% <100.00%> (+11.42%) ⬆️
...ages/impl/timeline/components/html/HtmlDocument.kt 66.28% <100.00%> (-0.20%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

0.0% 0.0% Coverage
0.0% 0.0% Duplication

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@jmartinesp jmartinesp merged commit bfd938a into develop Aug 21, 2023
@jmartinesp jmartinesp deleted the fix/jme/1079-pure-html-links-are-not-linkified branch August 21, 2023 14:31
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.

URLs in formatted text messages aren't linkified
3 participants