From 2ff1bfba4f2b9e1169f35a69633d46735e0d1011 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 16 May 2022 11:14:22 +0800 Subject: [PATCH] :bug: fix https://github.com/Vanessa219/vditor/issues/1228 --- CHANGELOG.md | 1 + src/ts/wysiwyg/highlightToolbarWYSIWYG.ts | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c78f8d99f..ac9d874fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -97,6 +97,7 @@ ### v3.8.15 / 2022-06 +* [1228](https://github.com/Vanessa219/vditor/issues/1228) 使用删除图标删除后,大纲没有自动更新 `修复缺陷` * [1230](https://github.com/Vanessa219/vditor/issues/1230) cnd preview path 重复加载问题 `改进功能` ### v3.8.14 / 2022-05 diff --git a/src/ts/wysiwyg/highlightToolbarWYSIWYG.ts b/src/ts/wysiwyg/highlightToolbarWYSIWYG.ts index 2bacee680..e083cdc60 100644 --- a/src/ts/wysiwyg/highlightToolbarWYSIWYG.ts +++ b/src/ts/wysiwyg/highlightToolbarWYSIWYG.ts @@ -31,6 +31,7 @@ import { } from "../util/selection"; import {afterRenderEvent} from "./afterRenderEvent"; import {removeBlockElement} from "./processKeydown"; +import {renderToc} from "../util/toc"; export const highlightToolbarWYSIWYG = (vditor: IVditor) => { clearTimeout(vditor.wysiwyg.hlToolbarTimeoutId); @@ -931,6 +932,9 @@ const genClose = (element: HTMLElement, vditor: IVditor) => { element.remove(); afterRenderEvent(vditor); highlightToolbarWYSIWYG(vditor); + if (["H1", "H2", "H3", "H4", "H5" ,"H6"].includes(element.tagName)) { + renderToc(vditor); + } }; vditor.wysiwyg.popover.insertAdjacentElement("beforeend", close); };