-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
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
Title anchor bug #107
Labels
bug
Something isn't working
Comments
Failed to get the title. There is a quick solution
|
My config: import React from 'react';
import { MdPreview, config } from 'md-editor-rt';
import ancher from 'markdown-it-anchor';
import slugify from 'slugify';
import 'md-editor-rt/lib/preview.css';
const mdHeadingId = (text) => slugify(text, {
lower: true,
strict: true,
replacement: '-',
});
config({
markdownItConfig(mdit) {
mdit.use(ancher, {
slugify: mdHeadingId, // to slugify cyrillic symbols
permalink: ancher.permalink.headerLink(),
});
},
});
function App() {
return <MdPreview modelValue={"## foo bar"} mdHeadingId={mdHeadingId} />
} Output: <h2 id="" tabindex="-1" data-line="0"><a class="header-anchor" href="#foo-bar">foo bar</a></h2> |
Not like this, the reason is with configuration I'll fix it in |
or try install yarn add md-editor-rt@beta |
The latest version has been released |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the issue
this configuration removes
id
from title ->expected result:
current:
Procedure version
markdown-it-anchor=8.6.7, md-editor-rt=4.6.1
Reproduction link
No response
The text was updated successfully, but these errors were encountered: