This fixes a regression caused by the sanitation update where links using the steam:// protocol will fail the check. Examples: at://did:plc:iif6bnwns5ikitrpwvlz2eo5/app.bsky.actor.profile/self (the website field) at://did:plc:iif6bnwns5ikitrpwvlz2eo5/app.bsky.feed.post/3leh2gsfu4u23 (the app.bsky.richtext.facet#link)
+1
-1
src/components/RichText.tsx
+1
-1
src/components/RichText.tsx
···
13
const WORD_WRAP = {wordWrap: 1}
14
// lifted from facet detection in `RichText` impl, _without_ `gm` flags
15
const URL_REGEX =
16
-
/(^|\s|\()((https?:\/\/[\S]+)|((?<domain>[a-z][a-z0-9]*(\.[a-z0-9]+)+)[\S]*))/i
17
18
export type RichTextProps = TextStyleProp &
19
Pick<TextProps, 'selectable' | 'onLayout' | 'onTextLayout'> & {
···
13
const WORD_WRAP = {wordWrap: 1}
14
// lifted from facet detection in `RichText` impl, _without_ `gm` flags
15
const URL_REGEX =
16
+
/(^|\s|\()((https?:\/\/[\S]+)|(steam:\/\/[\S]+)|((?<domain>[a-z][a-z0-9]*(\.[a-z0-9]+)+)[\S]*))/i
17
18
export type RichTextProps = TextStyleProp &
19
Pick<TextProps, 'selectable' | 'onLayout' | 'onTextLayout'> & {
+1
-1
src/lib/strings/website.ts
+1
-1
src/lib/strings/website.ts
History
1 round
2 comments
hatlink.bsky.social
submitted
#0
1 commit
expand
collapse
add steam uri to regex and make steam uri sanatize
no conflicts, ready to merge
expand 2 comments
the website field on bluesky profiles allows any uri! also other links should accept any URIs as well. If you make a new round of this PR or open a new one with this functionality, I'll definitely merge it! (but just limiting this to steam links would be ๐)
how about making a separate array of allowed schemes and iterating over it to make adding more easier? allowing any is probably also an option