fix: heading 的 anchor 按钮被删除后无法删除 tooltip 提示
This commit is contained in:
parent
8eb946c5ef
commit
48b8edc44a
|
@ -473,7 +473,10 @@ class NativeEvent {
|
|||
-1
|
||||
) {
|
||||
source = html;
|
||||
} else if (text && /^https?:\/\/\S+$/.test(text)) {
|
||||
} else if (
|
||||
text &&
|
||||
/^https?:\/\/\S+$/.test(text.toLowerCase().trim())
|
||||
) {
|
||||
const value = escape(text);
|
||||
source = `<a href="${value}" target="_blank">${value}</a>`;
|
||||
} else if (html) {
|
||||
|
|
|
@ -62,6 +62,7 @@ export default class extends BlockPlugin<Options> {
|
|||
const id = node.attributes('id');
|
||||
if (id) {
|
||||
node.find('.data-anchor-button').remove();
|
||||
Tooltip.hide();
|
||||
const button = $(
|
||||
`<a class="data-anchor-button"><span class="data-icon data-icon-${node.name}"></span></a>`,
|
||||
);
|
||||
|
@ -173,6 +174,7 @@ export default class extends BlockPlugin<Options> {
|
|||
|
||||
if (block.length === 0) {
|
||||
button.remove();
|
||||
Tooltip.hide();
|
||||
return;
|
||||
}
|
||||
const rootRect = root.get<Element>()?.getBoundingClientRect() || {
|
||||
|
@ -208,6 +210,7 @@ export default class extends BlockPlugin<Options> {
|
|||
button.find('.data-icon-'.concat(block.name)).length === 0)
|
||||
) {
|
||||
button.remove();
|
||||
Tooltip.hide();
|
||||
}
|
||||
|
||||
if (block.length === 0 || card.closest(block, true)) {
|
||||
|
|
Loading…
Reference in New Issue