diff --git a/cypress/integration/e2e/txt/append.spec.ts b/cypress/integration/e2e/txt/append.spec.ts index bad573c..889452b 100644 --- a/cypress/integration/e2e/txt/append.spec.ts +++ b/cypress/integration/e2e/txt/append.spec.ts @@ -11,7 +11,7 @@ describe('test editor.txt.append()', () => { cy.get('#div1').contains('欢迎使用 wangEditor 富文本编辑器') cy.getEditor().then((editor: Editor) => { - const menusLen = editor.menus.menuList.length + const menusLen = editor.menus.menuList.length + 1 cy.getByClass('toolbar') .children() .should('have.length', menusLen + 1) diff --git a/cypress/integration/e2e/txt/html.spec.ts b/cypress/integration/e2e/txt/html.spec.ts index bb3fd55..91b7e12 100644 --- a/cypress/integration/e2e/txt/html.spec.ts +++ b/cypress/integration/e2e/txt/html.spec.ts @@ -11,7 +11,7 @@ describe('test editor.txt.html()功能', () => { cy.get('#div1').contains('123456') cy.getEditor().then((editor: Editor) => { - const menusLen = editor.menus.menuList.length + const menusLen = editor.menus.menuList.length + 1 cy.getByClass('toolbar') .children() .should('have.length', menusLen + 1) diff --git a/src/config/lang.ts b/src/config/lang.ts index 2f6162f..7182d23 100644 --- a/src/config/lang.ts +++ b/src/config/lang.ts @@ -36,7 +36,7 @@ export default { 恢复: '恢复', 撤销: '撤销', 全屏: '全屏', - 代办事项: '代办事项', + 待办事项: '待办事项', }, dropListMenu: { 设置标题: '设置标题', @@ -164,7 +164,7 @@ export default { 恢复: 'undo', 撤销: 'redo', 全屏: 'fullscreen', - 代办事项: 'todo', + 待办事项: 'todo', }, dropListMenu: { 设置标题: 'title', diff --git a/src/menus/head/index.ts b/src/menus/head/index.ts index c03abb9..e796134 100644 --- a/src/menus/head/index.ts +++ b/src/menus/head/index.ts @@ -60,6 +60,15 @@ class Head extends DropListMenu implements MenuActive { return } + // 选中内容包含序列,code,表格,分割线时不处理 + if ( + ['OL', 'UL', 'LI', 'TABLE', 'TH', 'TR', 'CODE', 'HR'].indexOf( + $($selectionElem).getNodeName() + ) > -1 + ) { + return + } + editor.cmd.do('formatBlock', value) // 标题设置成功且不是

正文标签就配置大纲id diff --git a/src/menus/todo/index.ts b/src/menus/todo/index.ts index dab246c..da18e1e 100644 --- a/src/menus/todo/index.ts +++ b/src/menus/todo/index.ts @@ -9,7 +9,7 @@ import createTodo from './todo' class Todo extends BtnMenu implements MenuActive { constructor(editor: Editor) { const $elem = $( - `

+ `
` )