mirror of
https://github.com/directus/directus.git
synced 2026-02-11 09:55:06 -05:00
Prevent nested ternary expressions (#18376)
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
This commit is contained in:
@@ -228,8 +228,13 @@ function parseHTML(innerText?: string, isDirectInput = false) {
|
||||
}
|
||||
|
||||
let newHTML = input.value.innerText;
|
||||
let caretPos = 0;
|
||||
|
||||
const caretPos = isDirectInput ? previousCaretPos : window.getSelection()?.rangeCount ? position(input.value).pos : 0;
|
||||
if (isDirectInput) {
|
||||
caretPos = previousCaretPos;
|
||||
} else if (window.getSelection()?.rangeCount) {
|
||||
caretPos = position(input.value).pos;
|
||||
}
|
||||
|
||||
let lastMatchIndex = 0;
|
||||
const matches = newHTML.match(new RegExp(`${props.captureGroup}(?!</mark>)`, 'gi'));
|
||||
|
||||
Reference in New Issue
Block a user