feat: add RelayUrlSegment for ws:// and wss:// relay URIs
Adds a new RelayUrlSegment type to RichTextParser that detects and labels relay URIs (ws:// and wss:// schemes) as a distinct segment type, separate from generic LinkSegments. https://claude.ai/code/session_01U21sGdEEMLo4hY8dwxNzPr
This commit is contained in:
+2
@@ -245,6 +245,8 @@ class RichTextParser {
|
||||
|
||||
if (videos.contains(word)) return VideoSegment(word)
|
||||
|
||||
if (word.startsWith("ws://", ignoreCase = true) || word.startsWith("wss://", ignoreCase = true)) return RelayUrlSegment(word)
|
||||
|
||||
if (urls.contains(word)) return LinkSegment(word)
|
||||
|
||||
if (CustomEmoji.fastMightContainEmoji(word, emojis) && emojis.any { word.contains(it.key) }) return EmojiSegment(word)
|
||||
|
||||
+5
@@ -146,6 +146,11 @@ class SchemelessUrlSegment(
|
||||
val extras: String?,
|
||||
) : Segment(segment)
|
||||
|
||||
@Immutable
|
||||
class RelayUrlSegment(
|
||||
segment: String,
|
||||
) : Segment(segment)
|
||||
|
||||
@Immutable
|
||||
class RegularTextSegment(
|
||||
segment: String,
|
||||
|
||||
Reference in New Issue
Block a user