Skip to content

Commit

Permalink
Remove unnecessary code
Browse files Browse the repository at this point in the history
  • Loading branch information
Skalakid committed Sep 6, 2024
1 parent 24ab088 commit a722236
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/web/utils/parserUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,6 @@ function moveCursor(isFocused: boolean, alwaysMoveCursorToTheEnd: boolean, curso
}
}

function normalizeHTMLStructure(target: MarkdownTextInputElement) {
return target.innerHTML.split('z-index: 1;').join('').split(' style=""').join('');
}

function updateInputStructure(
target: MarkdownTextInputElement,
text: string,
Expand Down Expand Up @@ -278,14 +274,15 @@ function updateInputStructure(
if (text) {
const {dom, tree} = parseRangesToHTMLNodes(text, markdownRanges, markdownStyle);

if (shouldForceDOMUpdate || normalizeHTMLStructure(targetElement) !== dom.innerHTML) {
if (shouldForceDOMUpdate || targetElement.innerHTML !== dom.innerHTML) {
targetElement.innerHTML = '';
targetElement.innerText = '';
targetElement.innerHTML = dom.innerHTML;
}

targetElement.tree = tree;
updateTreeElementRefs(tree, targetElement);
targetElement.tree = tree;

moveCursor(isFocused, alwaysMoveCursorToTheEnd, cursorPosition, targetElement);
}

Expand Down

0 comments on commit a722236

Please sign in to comment.