This commit is contained in:
parent
7a94ff581b
commit
0ab814f7e4
1 changed files with 2 additions and 2 deletions
|
@ -257,8 +257,8 @@ export class Toolbar {
|
|||
return;
|
||||
}
|
||||
// 对已有字体样式的文字再次添加字体样式
|
||||
if (focusAdd && action === "add" && types.includes("bold") &&
|
||||
this.range.toString() === this.range.commonAncestorContainer.textContent) {
|
||||
if (focusAdd && action === "add" && types.includes("bold") && this.range.startContainer.nodeType === 3 &&
|
||||
this.range.startContainer.parentNode.isSameNode(this.range.endContainer.parentNode)) {
|
||||
return;
|
||||
}
|
||||
let startElement = this.range.startContainer as Element;
|
||||
|
|
Loading…
Add table
Reference in a new issue