Skip to content

Commit

Permalink
🐛 #12877
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Oct 24, 2024
1 parent 41370ad commit 5281422
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/src/protyle/toolbar/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,12 @@ export class Toolbar {
this.range = setLastNodeRange(getContenteditableElement(nodeElement), this.range, false);
}
const rangeTypes = this.getCurrentType(this.range);

// https://github.com/siyuan-note/siyuan/issues/6501
// https://github.com/siyuan-note/siyuan/issues/12877
if (rangeTypes.length === 1 && ["block-ref", "file-annotation-ref", "a", "inline-memo", "inline-math", "tag"].includes(rangeTypes[0]) && type === "clear") {
return;
}
const selectText = this.range.toString();
fixTableRange(this.range);
let previousElement: HTMLElement;
Expand Down Expand Up @@ -487,7 +493,7 @@ export class Toolbar {
hasSameTextStyle(item, nextElement, textObj)) {
nextIndex = item.textContent.length;
nextElement.innerHTML = item.textContent + nextElement.innerHTML;
} else if (item.textContent !== Constants.ZWSP) {
} else if (item.textContent !== Constants.ZWSP) {
const inlineElement = document.createElement("span");
inlineElement.setAttribute("data-type", type);
inlineElement.textContent = item.textContent;
Expand Down

0 comments on commit 5281422

Please sign in to comment.