Skip to content

插入HTML块报错问题: #38

@idea-zone

Description

@idea-zone

Siyuan 版本 v3.1.32
下面代码会报错:

   this.protyleSlash = [{
            filter: ["insert button", "插入按钮", "crbutton"],
            html: `<div class="b3-list-item__first"><span class="b3-list-item__text">${this.i18n.insertEmoji}</span><span class="b3-list-item__meta"></span></div>`,
            id: "insertEmoji",
            callback(protyle: Protyle) {
            protyle.insert("<div><button>button</button></div>");
            }

            // protyle.transaction();
        }]; 

报错

Uncaught TypeError: Cannot read properties of undefined (reading 'childNodes')
    at ot (main.9432226dfb4f4cb6e0c2.js:4259:5460)
    at Zc (main.9432226dfb4f4cb6e0c2.js:4259:7468)
    at HTMLDivElement.<anonymous> (main.9432226dfb4f4cb6e0c2.js:4368:6828)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions