Skip to content

Commit

Permalink
Fix Markdown Input clearing (#236)
Browse files Browse the repository at this point in the history
  • Loading branch information
Skalakid authored Mar 14, 2024
1 parent 1fca8eb commit b9720d3
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 @@ -187,7 +187,7 @@ function parseText(target: HTMLElement, text: string, curosrPositionIndex: numbe
const markdownRanges: MarkdownRange[] = ranges as MarkdownRange[];
const rootSpan = targetElement.firstChild as HTMLElement | null;

if (targetElement.innerHTML === '<br>' || (rootSpan && rootSpan.innerHTML === '\n')) {
if (!text || targetElement.innerHTML === '<br>' || (rootSpan && rootSpan.innerHTML === '\n')) {
targetElement.innerHTML = '';
targetElement.innerText = '';
}
Expand Down

0 comments on commit b9720d3

Please sign in to comment.