[visual] Add decorations for \textsuperscript and \textsubscript (#14153)

GitOrigin-RevId: 7a5bfc7077131dab7ba9569b7edc0d5daad65347
This commit is contained in:
Alf Eaton 2023-08-11 09:11:10 +01:00 committed by Copybot
parent 32d5c99cdc
commit 971e0f0e84
3 changed files with 14 additions and 0 deletions

View file

@ -936,6 +936,8 @@ export const atomicDecorations = (options: Options) => {
'\\texttt',
'\\textmd',
'\\textsf',
'\\textsuperscript',
'\\textsubscript',
'\\sout',
'\\emph',
].includes(commandName)

View file

@ -248,6 +248,16 @@ export const visualTheme = EditorView.theme({
'.ol-cm-command-textsf': {
fontFamily: 'var(--source-font-family)',
},
'.ol-cm-command-textsuperscript': {
verticalAlign: 'super',
fontSize: 'smaller',
lineHeight: 'calc(var(--line-height) / 2)',
},
'.ol-cm-command-textsubscript': {
verticalAlign: 'sub',
fontSize: 'smaller',
lineHeight: 'calc(var(--line-height) / 2)',
},
'.ol-cm-command-underline': {
textDecoration: 'underline',
},

View file

@ -154,6 +154,8 @@ describe('<CodeMirrorEditor/> in Visual mode', function () {
'texttt',
'textmd',
'textsf',
'textsubscript',
'textsuperscript',
'sout',
'emph',
'url',