We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import { MdPreview, MdCatalog, config } from 'md-editor-rt'; import 'md-editor-rt/lib/style.css'; import './viwerServerComponent.css'; import ancher from 'markdown-it-anchor'; export default function ViwerServerComponent({ post }: { post: any }) { const id_preview: string = 'preview'; config({ markdownItConfig(mdit) { mdit.use(ancher, { permalink: ancher.permalink.headerLink(), permalinkClass: 'header-anchor', // Classe CSS para o link de permalink permalinkBefore: false, // Coloca o link de permalink após o título slugify: (s: any) => s .toLowerCase() // Converte para minúsculas .replace(/[^\w\u4e00-\u9fa5]+/g, '-') // Substitui caracteres especiais por hífens .replace(/^-+|-+$/g, ''), // Remove hífens no início e no fim }); }, }); // const scrollElement = document.documentElement; const mdHeadingId = (_text: string, _level: number, index: number) => `${_text .toLowerCase() .replace(/[^\w\u4e00-\u9fa5]+/g, '-') .replace(/^-+|-+$/g, '')}`; return ( <div className='container_2'> <div className='doc_2'> <div className='content_2'> <MdPreview id='preview' value={post.data} language="pt-BR" previewTheme="github" showCodeRowNumber={true} mdHeadingId={mdHeadingId} > </MdPreview> </div> {/* <div className='catalog_2'> <div className='affix'><MdCatalog editorId='preview' scrollElement={scrollElement} /></div> </div> */} </div> </div> ); }
nodejs: v22.12.0 "dependencies": { "@vavt/cm-extension": "^1.6.0", "@vavt/v3-extension": "^3.0.0", "cookies-next": "^5.1.0", "markdown-it-anchor": "^9.2.0", "md-editor-rt": "^5.2.1", "next": "15.1.6", "react": "^19.0.0", "react-dom": "^19.0.0", "sanitize-html": "^2.14.0" },
No response
The text was updated successfully, but these errors were encountered:
Can you provide a full demo that can be run right away?
Sorry, something went wrong.
No branches or pull requests
描述这个Bug
版本号
nodejs: v22.12.0 "dependencies": { "@vavt/cm-extension": "^1.6.0", "@vavt/v3-extension": "^3.0.0", "cookies-next": "^5.1.0", "markdown-it-anchor": "^9.2.0", "md-editor-rt": "^5.2.1", "next": "15.1.6", "react": "^19.0.0", "react-dom": "^19.0.0", "sanitize-html": "^2.14.0" },
问题重现链接
No response
The text was updated successfully, but these errors were encountered: