Skip to content

Commit

Permalink
fix: paste rich text with br should keep line break
Browse files Browse the repository at this point in the history
  • Loading branch information
ybzky committed Feb 18, 2025
1 parent a2e3ae0 commit 6c69a30
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,12 @@ export class HtmlToUSMService {
}
} else if (node.nodeType === Node.COMMENT_NODE || node.nodeName === 'STYLE') {
continue;
} else if (node.nodeName.toLowerCase() === 'br') {
if (!doc.paragraphs) {
doc.paragraphs = [];
}
doc.paragraphs.push({ startIndex: doc.dataStream.length });
doc.dataStream += '\r';
} else if (node.nodeType === Node.ELEMENT_NODE) {
const currentNodeStyle = this._getStyle(node as HTMLElement, styleStr);
const parentStyles = parent ? styleCache.get(parent) : {};
Expand Down

0 comments on commit 6c69a30

Please sign in to comment.