improve markdown rendering

This commit is contained in:
josc146
2024-03-13 15:36:02 +08:00
parent 7fbcb5e810
commit 3a637a973c
5 changed files with 166 additions and 33 deletions

View File

@@ -23,7 +23,7 @@ const Hyperlink: FC<any> = ({ href, children }) => {
const MarkdownRender: FC<ReactMarkdownOptions & { disabled?: boolean }> = (props) => {
return (
<div dir="auto" className="markdown-body">
<div dir="auto" className="prose markdown-body" style={{ maxWidth: '100%' }}>
{props.disabled ?
<div style={{ whiteSpace: 'pre-wrap' }}>
{props.children}

View File

@@ -46,48 +46,24 @@ body {
overflow-y: auto;
overflow-x: hidden;
ul,
ol {
padding-left: 1.5em;
}
ol {
list-style: none;
counter-reset: item;
li {
counter-increment: item;
&::marker {
content: counter(item) '. ';
}
}
}
pre {
padding: 0;
background: transparent;
code {
font-size: 14px;
}
}
p {
margin: 0 0 10px;
}
code {
padding: 0 0.4em;
margin: 0;
white-space: pre-wrap;
word-break: break-word;
border-radius: 8px;
background-color: var(--color-neutral-muted);
font-size: 11px;
}
.hljs {
padding: 0;
}
details summary {
cursor: pointer;
}
}