mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-28 20:38:49 +01:00
This commit is contained in:
parent
e8de30d2a2
commit
ddade75004
1 changed files with 10 additions and 0 deletions
|
|
@ -462,6 +462,11 @@ export class Toolbar {
|
|||
item.textContent !== Constants.ZWSP ||
|
||||
// tag 会有零宽空格 https://github.com/siyuan-note/siyuan/issues/12922
|
||||
(item.textContent === Constants.ZWSP && !rangeTypes.includes("img"))) {
|
||||
// ZWSP spin 后会在行内元素外 https://github.com/siyuan-note/siyuan/issues/13871
|
||||
if (item.textContent.startsWith(Constants.ZWSP)) {
|
||||
newNodes.push(document.createTextNode(Constants.ZWSP));
|
||||
item.textContent = item.textContent.substring(1);
|
||||
}
|
||||
const inlineElement = document.createElement("span");
|
||||
inlineElement.setAttribute("data-type", type);
|
||||
inlineElement.textContent = item.textContent;
|
||||
|
|
@ -486,6 +491,11 @@ export class Toolbar {
|
|||
if (!types.includes("img")) {
|
||||
types.push(type);
|
||||
}
|
||||
// 以下行内元素需用 ZWSP 开头 https://github.com/siyuan-note/siyuan/issues/13871
|
||||
if ((types.includes("code") || types.includes("tag") || types.includes("kbd")) &&
|
||||
!item.textContent.startsWith(Constants.ZWSP)) {
|
||||
item.insertAdjacentText("afterbegin", Constants.ZWSP);
|
||||
}
|
||||
// 上标和下标不能同时存在 https://github.com/siyuan-note/insider/issues/1049
|
||||
if (type === "sub" && types.includes("sup")) {
|
||||
types.find((item, index) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue