change sup and sub in mde editor

This commit is contained in:
thomas girod 2024-07-08 17:04:18 +02:00
parent 30948f1701
commit 7f6c4f6236

View File

@ -74,7 +74,7 @@
name: "superscript",
action: function customFunction(editor){
let cm = editor.codemirror;
cm.replaceSelection('<sup>' + cm.getSelection() + '</sup>');
cm.replaceSelection('^' + cm.getSelection() + '^');
},
className: "fa fa-superscript",
title: "{{ translations.superscript }}"
@ -83,7 +83,7 @@
name: "subscript",
action: function customFunction(editor){
let cm = editor.codemirror;
cm.replaceSelection('<sub>' + cm.getSelection() + '</sub>');
cm.replaceSelection('~' + cm.getSelection() + '~');
},
className: "fa fa-subscript",
title: "{{ translations.subscript }}"