fix list numbering

main
Cogent Apps 2023-03-19 02:46:33 -07:00 committed by GitHub
parent 583eab23c8
commit 216ecd5b32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -74,6 +74,11 @@ export function Markdown(props: MarkdownProps) {
remarkPlugins={[remarkGfm, remarkMath]} remarkPlugins={[remarkGfm, remarkMath]}
rehypePlugins={[rehypeKatex]} rehypePlugins={[rehypeKatex]}
components={{ components={{
ol({ start, children }) {
return <ol start={start ?? 1} style={{ counterReset: `list-item ${(start || 1) - 1}` }}>
{children}
</ol>;
},
code({ node, inline, className, children, ...props }) { code({ node, inline, className, children, ...props }) {
const match = /language-(\w+)/.exec(className || '') const match = /language-(\w+)/.exec(className || '')
const code = String(children); const code = String(children);