Remove /tex command

This commit is contained in:
Sven Mäder 2021-01-29 13:05:49 +01:00
parent c4f0987487
commit bcc0697710
3 changed files with 44 additions and 83 deletions

View file

@ -48,7 +48,6 @@ import SettingsStore from "./settings/SettingsStore";
import {UIFeature} from "./settings/UIFeature";
import {CHAT_EFFECTS} from "./effects"
import CallHandler from "./CallHandler";
import {markdownSerializeIfNeeded} from './editor/serialize';
// XXX: workaround for https://github.com/microsoft/TypeScript/issues/31816
interface HTMLInputEvent extends Event {
@ -224,23 +223,6 @@ export const Commands = [
},
category: CommandCategories.messages,
}),
new Command({
command: 'tex',
args: '<message>',
description: _td('Sends a message in TeX mode, without restrictions'),
runFn: function(roomId, args) {
if (SettingsStore.getValue("feature_latex_maths")) {
if (args) {
const html = markdownSerializeIfNeeded(args, {forceHTML: false}, {forceTEX: true});
return success(MatrixClientPeg.get().sendHtmlMessage(roomId, args, html));
}
return reject(this.getUsage());
} else {
return reject("Render LaTeX maths in messages needs to be enabled in Labs");
}
},
category: CommandCategories.messages,
}),
new Command({
command: 'ddg',
args: '<query>',