mirror of
https://github.com/zadam/trilium.git
synced 2026-05-06 09:36:37 +02:00
feat(revisions): preserve monospace for code notes diff
This commit is contained in:
@@ -210,6 +210,15 @@ body.desktop .revisions-dialog {
|
||||
}
|
||||
}
|
||||
|
||||
.revision-diff-code {
|
||||
font-family: var(--font-family-monospace, monospace);
|
||||
font-size: 0.9rem;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-all;
|
||||
max-width: 100%;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* HTML diff styles (htmldiff-js) */
|
||||
.revision-diff-content {
|
||||
ins {
|
||||
|
||||
@@ -488,7 +488,7 @@ function RevisionContent({ noteContent, revisionItem, fullRevision, showDiff }:
|
||||
case "text":
|
||||
return <RevisionContentText content={content} />;
|
||||
case "code":
|
||||
return <pre style={CODE_STYLE}>{content}</pre>;
|
||||
return <div className="revision-diff-code">{content}</div>;
|
||||
case "image":
|
||||
switch (revisionItem.mime) {
|
||||
case "image/svg+xml": {
|
||||
@@ -571,7 +571,7 @@ function RevisionContentDiff({ noteContent, itemContent, itemType }: {
|
||||
}
|
||||
}, [noteContent, itemContent, itemType]);
|
||||
|
||||
return <div ref={contentRef} className={clsx("revision-diff-content", { "ck-content": itemType === "text" })} style={itemType !== "text" ? { whiteSpace: "pre-wrap" } : undefined} />;
|
||||
return <div ref={contentRef} className={clsx("revision-diff-content", itemType === "text" ? "ck-content" : "revision-diff-code")} />;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user