Describe the bug
Refer the code below
'use server';
import React from "react";
import { fromAsyncCodeToHtml } from '@shikijs/markdown-it/async'
import MarkdownItAsync from 'markdown-it-async'
import { codeToHtml } from 'shiki' // Or your custom shorthand bundle
import './MarkdownStyles.css'
// Initialize MarkdownIt instance with markdown-it-async
const md = MarkdownItAsync()
md.use(
fromAsyncCodeToHtml(
// Pass the codeToHtml function
codeToHtml,
{
themes: {
light: 'night-owl',
dark: 'github-dark',
}
}
)
)
const MarkdownRenderer: React.FC<{ content: string }> = async ({ content }) => {
const html = await md.renderAsync(content)
// const html = await md.renderAsync('# Title\n```ts\nconsole.log("Hello, World!")\n```')
return <div className="markdown-body">
<div dangerouslySetInnerHTML={{__html: html}}></div>
</div>;
};
export default MarkdownRenderer;
I am getting this err when my markdown string includes - Numbered list
Error: isSpace is not defined

for instance
1. Do not use the built-in method.
2. Should work for all JavaScript environments.
Reproduction
use markdown string with numbered list
System Info
System:
OS: macOS 12.7.6
CPU: (4) x64 Intel(R) Core(TM) i5-5350U CPU @ 1.80GHz
Memory: 23.76 MB / 8.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 22.12.0 - ~/.nvm/versions/node/v22.12.0/bin/node
Yarn: 1.22.22 - ~/.nvm/versions/node/v22.12.0/bin/yarn
npm: 10.9.0 - ~/.nvm/versions/node/v22.12.0/bin/npm
Watchman: 2022.03.21.00 - /usr/local/bin/watchman
Browsers:
Brave Browser: 126.1.67.116
Chrome: 133.0.6943.55
Safari: 17.6
Used Package Manager
npm
Validations
Contributions
Describe the bug
Refer the code below
I am getting this err when my markdown string includes - Numbered list
Error: isSpace is not definedfor instance
Reproduction
use markdown string with numbered list
System Info
System: OS: macOS 12.7.6 CPU: (4) x64 Intel(R) Core(TM) i5-5350U CPU @ 1.80GHz Memory: 23.76 MB / 8.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 22.12.0 - ~/.nvm/versions/node/v22.12.0/bin/node Yarn: 1.22.22 - ~/.nvm/versions/node/v22.12.0/bin/yarn npm: 10.9.0 - ~/.nvm/versions/node/v22.12.0/bin/npm Watchman: 2022.03.21.00 - /usr/local/bin/watchman Browsers: Brave Browser: 126.1.67.116 Chrome: 133.0.6943.55 Safari: 17.6Used Package Manager
npm
Validations
Contributions