You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-08 21:42:24 +03:00
Refactor to use HtmlUtils for linkifying and sanitizing
Signed-off-by: Bastian <matrix@noxware.de>
This commit is contained in:
@@ -27,12 +27,7 @@ import SettingsStore, {SettingLevel} from './settings/SettingsStore';
|
||||
import {MATRIXTO_URL_PATTERN} from "./linkify-matrix";
|
||||
import * as querystring from "querystring";
|
||||
import MultiInviter from './utils/MultiInviter';
|
||||
import * as linkify from 'linkifyjs';
|
||||
import linkifyString from 'linkifyjs/string';
|
||||
import linkifyMatrix from './linkify-matrix';
|
||||
import sanitizeHtml from 'sanitize-html';
|
||||
|
||||
linkifyMatrix(linkify);
|
||||
import { linkifyAndSanitizeHtml } from './HtmlUtils';
|
||||
|
||||
class Command {
|
||||
constructor({name, args='', description, runFn, hideCompletionAfterSpace=false}) {
|
||||
@@ -154,7 +149,7 @@ export const CommandMap = {
|
||||
|
||||
const topicEvents = room.currentState.getStateEvents('m.room.topic', '');
|
||||
const topic = topicEvents.getContent().topic;
|
||||
const topicHtml = topic ? linkifyString(sanitizeHtml(topic)) : _t('This room has no topic.');
|
||||
const topicHtml = topic ? linkifyAndSanitizeHtml(topic) : _t('This room has no topic.');
|
||||
|
||||
const InfoDialog = sdk.getComponent('dialogs.InfoDialog');
|
||||
Modal.createTrackedDialog('Slash Commands', 'Topic', InfoDialog, {
|
||||
|
||||
Reference in New Issue
Block a user