mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
fix: max height of memo content compact mode
This commit is contained in:
@@ -8,7 +8,7 @@ interface Props extends BaseProps {
|
||||
|
||||
const Blockquote: React.FC<Props> = ({ children }: Props) => {
|
||||
return (
|
||||
<blockquote className="p-2 border-s-4 border-gray-300 bg-gray-50 dark:border-gray-500 dark:bg-zinc-700">
|
||||
<blockquote className="p-2 border-s-4 rounded border-gray-300 bg-gray-50 dark:border-gray-500 dark:bg-zinc-700">
|
||||
{children.map((child, index) => (
|
||||
<Renderer key={`${child.type}-${index}`} index={String(index)} node={child} />
|
||||
))}
|
||||
|
@@ -40,7 +40,7 @@ const CodeBlock: React.FC<Props> = ({ language, content }: Props) => {
|
||||
return <MermaidBlock content={content} />;
|
||||
}
|
||||
|
||||
const highlightedCode: string = useMemo(() => {
|
||||
const highlightedCode = useMemo(() => {
|
||||
try {
|
||||
const lang = hljs.getLanguage(formatedLanguage);
|
||||
if (lang) {
|
||||
@@ -52,7 +52,7 @@ const CodeBlock: React.FC<Props> = ({ language, content }: Props) => {
|
||||
// Skip error and use default highlighted code.
|
||||
}
|
||||
|
||||
// escape any HTML entities when rendering original content
|
||||
// Escape any HTML entities when rendering original content.
|
||||
return Object.assign(document.createElement("span"), {
|
||||
textContent: content,
|
||||
}).innerHTML;
|
||||
|
@@ -80,7 +80,7 @@ const MemoContent: React.FC<Props> = (props: Props) => {
|
||||
ref={memoContentContainerRef}
|
||||
className={clsx(
|
||||
"relative w-full max-w-full word-break text-base leading-snug space-y-2 whitespace-pre-wrap",
|
||||
showCompactMode && "line-clamp-6",
|
||||
showCompactMode && "line-clamp-6 max-h-44",
|
||||
contentClassName,
|
||||
)}
|
||||
onClick={handleMemoContentClick}
|
||||
@@ -91,7 +91,6 @@ const MemoContent: React.FC<Props> = (props: Props) => {
|
||||
skipNextLineBreakFlag = false;
|
||||
return null;
|
||||
}
|
||||
|
||||
prevNode = node;
|
||||
skipNextLineBreakFlag = true;
|
||||
return <Renderer key={`${node.type}-${index}`} index={String(index)} node={node} />;
|
||||
|
Reference in New Issue
Block a user