Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 authored and stevapple committed Apr 8, 2020
1 parent a8347b9 commit 2c4fc8a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ts/ir/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ export const input = (vditor: IVditor, range: Range) => {
}
}

if (startSpace || endSpace) {
if ((startSpace || endSpace)
// insert table
&& !blockElement.querySelector("wbr")) {
blockElement.classList.add("vditor-ir__node--expand");
return;
}
Expand Down
3 changes: 3 additions & 0 deletions src/ts/ir/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ export const processToolbar = (vditor: IVditor, actionBtn: Element, prefix: stri
} else {
html = `${prefix}${range.toString()}<wbr>${prefix}`;
}
if (commandName === "table" || commandName === "code") {
html = "\n" + html + "\n";
}
document.execCommand("insertHTML", false, html);
}
}
Expand Down

0 comments on commit 2c4fc8a

Please sign in to comment.