Skip to content

Commit

Permalink
Fix showing wrongly formatted text (#374)
Browse files Browse the repository at this point in the history
  • Loading branch information
zfurtak authored Jul 18, 2024
1 parent 3127736 commit 8117369
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/web/parserUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ function parseText(target: HTMLElement, text: string, cursorPositionIndex: numbe
if (text) {
const dom = parseRangesToHTMLNodes(text, markdownRanges, markdownStyle);

if (!rootSpan || rootSpan.innerHTML !== dom.innerHTML) {
if (!rootSpan || !rootSpan?.classList?.contains('root') || rootSpan.innerHTML !== dom.innerHTML) {
targetElement.innerHTML = '';
targetElement.innerText = '';
target.appendChild(dom);
Expand Down

0 comments on commit 8117369

Please sign in to comment.