Vanessa 2024-04-05 22:46:57 +08:00
parent 41d03c92b9
commit 0081f4f793
2 changed files with 5 additions and 3 deletions

View file

@ -565,11 +565,13 @@ ${padHTML}
});
}
public render(protyle: IProtyle, update = false) {
public render(protyle: IProtyle, update = false, nodeElement?: Element | false) {
/// #if !MOBILE
let range: Range;
let blockElement: Element;
if (getSelection().rangeCount > 0) {
if (nodeElement) {
blockElement = nodeElement
} else if (getSelection().rangeCount > 0) {
range = getSelection().getRangeAt(0);
if (!protyle.wysiwyg.element.isEqualNode(range.startContainer) && !protyle.wysiwyg.element.contains(range.startContainer)) {
if (protyle.element.id === "searchPreview") {

View file

@ -1980,7 +1980,7 @@ export class WYSIWYG {
});
// 面包屑定位,需至于前,否则 return 的元素就无法进行面包屑定位
if (protyle.options.render.breadcrumb) {
protyle.breadcrumb.render(protyle);
protyle.breadcrumb.render(protyle, false, hasClosestBlock(event.target));
}
const range = getEditorRange(this.element);
// 需放在嵌入块之前否则嵌入块内的引用、链接、pdf 双链无法点击打开 https://ld246.com/article/1630479789513