fix list numbering

This commit is contained in:
Cogent Apps
2023-03-19 02:46:33 -07:00
committed by GitHub
parent 583eab23c8
commit 216ecd5b32

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);