fix list numbering
parent
583eab23c8
commit
216ecd5b32
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue