Page MenuHomePhabricator

D8853.id30037.diff
No OneTemporary

D8853.id30037.diff

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
@@ -11,6 +11,7 @@
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 +199,25 @@
state: SharedMarkdown.State,
) => <strong key={state.key}>{node.content}</strong>,
},
+ chatMention: {
+ ...SimpleMarkdown.defaultRules.strong,
+ match: SharedMarkdown.matchChatMentions(),
+ 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

Mime Type
text/plain
Expires
Wed, Nov 27, 7:30 PM (22 h, 25 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2591451
Default Alt Text
D8853.id30037.diff (1 KB)

Event Timeline