Vanessa 2024-05-15 17:31:40 +08:00
parent 0fa75ec71a
commit 43359889d1
2 changed files with 3 additions and 3 deletions

View file

@ -609,7 +609,7 @@
&-task { &-task {
list-style: none !important; list-style: none !important;
word-break: break-all; word-break: break-word;
position: relative; position: relative;
&--done > div[data-node-id].p { &--done > div[data-node-id].p {

View file

@ -75,7 +75,7 @@ export const highlightRender = (element: Element, cdn = Constants.PROTYLE_CDN) =
const lineNumber = block.parentElement.getAttribute("linenumber"); const lineNumber = block.parentElement.getAttribute("linenumber");
if (autoEnter === "true" || (autoEnter !== "false" && window.siyuan.config.editor.codeLineWrap)) { if (autoEnter === "true" || (autoEnter !== "false" && window.siyuan.config.editor.codeLineWrap)) {
block.style.setProperty("white-space", "pre-wrap"); block.style.setProperty("white-space", "pre-wrap");
block.style.setProperty("word-break", "break-all"); block.style.setProperty("word-break", "break-word");
} else { } else {
// https://ld246.com/article/1684031600711 该属性会导致有 tab 后光标跳至末尾,目前无解 // https://ld246.com/article/1684031600711 该属性会导致有 tab 后光标跳至末尾,目前无解
block.style.setProperty("white-space", "pre"); block.style.setProperty("white-space", "pre");
@ -137,7 +137,7 @@ export const lineNumberRender = (block: HTMLElement) => {
if (lineList[lineList.length - 1] === "" && lineList.length > 1) { if (lineList[lineList.length - 1] === "" && lineList.length > 1) {
lineList.pop(); lineList.pop();
} }
const isWrap = block.style.wordBreak === "break-all"; const isWrap = block.style.wordBreak === "break-word";
lineList.map((line) => { lineList.map((line) => {
let lineHeight = ""; let lineHeight = "";
if (isWrap) { if (isWrap) {