Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Add comment for MessageWillFormat plugin hook #2035

Merged
merged 1 commit into from Nov 13, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions plugins/registry.js
Expand Up @@ -282,6 +282,11 @@ export default class PluginRegistry {
unregisterPluginReconnectHandler(this.id);
}

// Register a hook that will be called before a message is formatted into Markdown.
// Accepts a function that receives the unmodified post and the message (potentially
// already modified by other hooks) as arguments. This function must return a string
// message that will be formatted.
// Returns a unique identifier.
registerMessageWillFormatHook(hook) {
const id = generateId();

Expand Down