You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-07 10:46:24 +03:00
correctly send pills in messages
This commit is contained in:
@@ -133,7 +133,10 @@ export default class Markdown {
|
||||
* Render the markdown message to plain text. That is, essentially
|
||||
* just remove any backslashes escaping what would otherwise be
|
||||
* markdown syntax
|
||||
* (to fix https://github.com/vector-im/riot-web/issues/2870)
|
||||
* (to fix https://github.com/vector-im/riot-web/issues/2870).
|
||||
*
|
||||
* N.B. this does **NOT** render arbitrary MD to plain text - only MD
|
||||
* which has no formatting. Otherwise it emits HTML(!).
|
||||
*/
|
||||
toPlaintext() {
|
||||
const renderer = new commonmark.HtmlRenderer({safe: false});
|
||||
@@ -161,6 +164,14 @@ export default class Markdown {
|
||||
if (is_multi_line(node) && node.next) this.lit('\n\n');
|
||||
};
|
||||
|
||||
// convert MD links into console-friendly ' < http://foo >' style links
|
||||
// ...except given this function never gets called with links, it's useless.
|
||||
// renderer.link = function(node, entering) {
|
||||
// if (!entering) {
|
||||
// this.lit(` < ${node.destination} >`);
|
||||
// }
|
||||
// };
|
||||
|
||||
return renderer.render(this.parsed);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user