mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-02 18:20:26 +08:00
This commit is contained in:
parent
23fbf94e8a
commit
79812f22b6
@ -291,10 +291,15 @@ export const setFontStyle = (textElement: HTMLElement, textOption: ITextOption)
|
|||||||
const setBlockRef = (blockRefOption: string) => {
|
const setBlockRef = (blockRefOption: string) => {
|
||||||
const blockRefData = blockRefOption.split(Constants.ZWSP);
|
const blockRefData = blockRefOption.split(Constants.ZWSP);
|
||||||
// 标签等元素中包含 ZWSP,需移除后拼接 https://github.com/siyuan-note/siyuan/issues/6466
|
// 标签等元素中包含 ZWSP,需移除后拼接 https://github.com/siyuan-note/siyuan/issues/6466
|
||||||
textElement.setAttribute("data-id", blockRefData.splice(0, 1)[0]);
|
const id = blockRefData.splice(0, 1)[0];
|
||||||
|
textElement.setAttribute("data-id", id);
|
||||||
textElement.setAttribute("data-subtype", blockRefData.splice(0, 1)[0]);
|
textElement.setAttribute("data-subtype", blockRefData.splice(0, 1)[0]);
|
||||||
textElement.removeAttribute("data-href");
|
textElement.removeAttribute("data-href");
|
||||||
textElement.innerText = blockRefData.join("");
|
let text = blockRefData.join("");
|
||||||
|
if (text.replace(/\s/g, "") === "") {
|
||||||
|
text = id;
|
||||||
|
}
|
||||||
|
textElement.innerText = text;
|
||||||
};
|
};
|
||||||
const setLink = (textOption: string) => {
|
const setLink = (textOption: string) => {
|
||||||
const options = textOption.split(Constants.ZWSP);
|
const options = textOption.split(Constants.ZWSP);
|
||||||
|
Loading…
Reference in New Issue
Block a user