-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Port over linkifyJS to shared-components. #32731
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
Changes from 31 commits
a253f84
a8efa1b
db34d93
6a57306
9a88517
291aa48
bc362bd
378abba
7198404
9cc4a6c
0ef3801
e8bd436
6488fdb
c0f3e37
c9cf144
c52d59d
ba405f5
878baef
861730c
79ea08a
f019cf3
d7a42d4
57e2d80
609da31
db98064
6068490
cd36c02
9549c7c
4263b28
4ca3c93
548b376
a83e18a
1707c33
e2aa463
51b8c6f
d9dd9cc
bceed65
813b295
c55a595
d1211f8
9bd6339
b048b00
34f0c35
73404ad
d92f671
e50b126
6dc68b7
eba6cf0
d606872
a9afb3d
5913893
4e6ef15
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,7 +55,7 @@ import InfoTooltip from "../views/elements/InfoTooltip"; | |
| import TextWithTooltip from "../views/elements/TextWithTooltip"; | ||
| import { useStateToggle } from "../../hooks/useStateToggle"; | ||
| import { getChildOrder } from "../../stores/spaces/SpaceStore"; | ||
| import { Linkify, topicToHtml } from "../../HtmlUtils"; | ||
| import { topicToHtml } from "../../HtmlUtils"; | ||
| import { useDispatcher } from "../../hooks/useDispatcher"; | ||
| import { Action } from "../../dispatcher/actions"; | ||
| import { type IState, RovingTabIndexProvider, useRovingTabIndex } from "../../accessibility/RovingTabIndex"; | ||
|
|
@@ -73,6 +73,7 @@ import SettingsStore from "../../settings/SettingsStore"; | |
| import { filterBoolean } from "../../utils/arrays.ts"; | ||
| import { type RoomViewStore } from "../../stores/RoomViewStore.tsx"; | ||
| import RoomContext from "../../contexts/RoomContext.ts"; | ||
| import { ElementLinkedText } from "../../Linkify.tsx"; | ||
|
|
||
| interface IProps { | ||
| space: Room; | ||
|
|
@@ -234,19 +235,10 @@ const Tile: React.FC<ITileProps> = ({ | |
| let topicSection: ReactNode | undefined; | ||
| if (topic) { | ||
| topicSection = ( | ||
| <Linkify | ||
| options={{ | ||
| attributes: { | ||
| onClick(ev: MouseEvent) { | ||
| // prevent clicks on links from bubbling up to the room tile | ||
| ev.stopPropagation(); | ||
| }, | ||
| }, | ||
| }} | ||
| > | ||
| <ElementLinkedText canClick={false}> | ||
|
||
| {" · "} | ||
| {topic} | ||
| </Linkify> | ||
| </ElementLinkedText> | ||
| ); | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this allow
data-linkifieduser-controlled from Matrix Events against the Matrix spec? iirc where we do something similar withstylewe have to manually sanitise it to ensure it only allows values the app injects rather than those from user-controller contentThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've written a test to check for this d9dd9cc.