The core now parses Markdown on its own so that it can convert it to the format specified in XEP-0393: Message Styling. This way the frontend doesn't need to construct references anymore. Just format them as markdown links, e.g.
Hey [@user](xmpp:user@prose.org)!
They will be automatically parsed and sent then.
Additionally Message now has content and rawContent where content is the HTML content of the message which should be rendered as-is, whereas the rawContent could be used for copying the message to the clipboard.
Note that existing messages will not be formatted. We could optimistically parse them, but XEP-0393 would change semantics when parsed as Markdown. We can add some heuristic if it's super annoying to browse the archive, like if sender and receiver are @prose.org, but that's not added yet.
API changes:
export class Message {
// …
/**
* The formatted HTML. Should be used for display.
*/
readonly content: string;
/**
* The original raw message. Can be used for copying the message.
*/
readonly rawContent: string;
/**
* Deprecated. Use `content` or `rawContent` instead.
*/
readonly text: string;
// …
}
export class SendMessageRequestBody {
// …
/**
* Deprecated.
* @param {Mention} _mention
*/
addMention(_mention: Mention): void;
/**
* Deprecated.
*/
readonly mentions: Mention[];
// …
}
The core now parses Markdown on its own so that it can convert it to the format specified in XEP-0393: Message Styling. This way the frontend doesn't need to construct references anymore. Just format them as markdown links, e.g.
They will be automatically parsed and sent then.
Additionally
Message
now hascontent
andrawContent
wherecontent
is the HTML content of the message which should be rendered as-is, whereas therawContent
could be used for copying the message to the clipboard.Note that existing messages will not be formatted. We could optimistically parse them, but XEP-0393 would change semantics when parsed as Markdown. We can add some heuristic if it's super annoying to browse the archive, like if sender and receiver are
@prose.org
, but that's not added yet.API changes: