Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33184479
D8853.1768533964.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D8853.1768533964.diff
View Options
diff --git a/web/markdown/rules.react.js b/web/markdown/rules.react.js
--- a/web/markdown/rules.react.js
+++ b/web/markdown/rules.react.js
@@ -5,12 +5,14 @@
import * as SimpleMarkdown from 'simple-markdown';
import * as SharedMarkdown from 'lib/shared/markdown.js';
+import { chatMentionRegex } from 'lib/shared/mention-utils.js';
import type {
RelativeMemberInfo,
ThreadInfo,
ChatMentionCandidates,
} from 'lib/types/thread-types.js';
+import MarkdownChatMention from './markdown-chat-mention.react.js';
import MarkdownSpoiler from './markdown-spoiler.react.js';
export type MarkdownRules = {
@@ -198,6 +200,25 @@
state: SharedMarkdown.State,
) => <strong key={state.key}>{node.content}</strong>,
},
+ chatMention: {
+ ...SimpleMarkdown.defaultRules.strong,
+ match: SimpleMarkdown.inlineRegex(chatMentionRegex),
+ parse: (capture: SharedMarkdown.Capture) =>
+ SharedMarkdown.parseChatMention(chatMentionCandidates, capture),
+ // eslint-disable-next-line react/display-name
+ react: (
+ node: SharedMarkdown.SingleASTNode,
+ output: SharedMarkdown.Output<SharedMarkdown.ReactElement>,
+ state: SharedMarkdown.State,
+ ) => (
+ <MarkdownChatMention
+ key={state.key}
+ threadInfo={node.threadInfo}
+ hasAccessToChat={node.hasAccessToChat}
+ text={node.content}
+ />
+ ),
+ },
},
};
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 16, 3:26 AM (18 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5941608
Default Alt Text
D8853.1768533964.diff (1 KB)
Attached To
Mode
D8853: [web] Add chat mention rule to text message rules
Attached
Detach File
Event Timeline
Log In to Comment