Skip to content
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

Bookmarks are not working #174

Closed
shajil-t opened this issue May 24, 2021 · 6 comments
Closed

Bookmarks are not working #174

shajil-t opened this issue May 24, 2021 · 6 comments

Comments

@shajil-t
Copy link

Headers doesn’t seems to be generating id when rendering as HTML hence the bookmarks are not working, is there any workaround for bookmarks to work?

[@uiw/react-md-editor": "3.0.8"]

Md

@jaywcjlove
Copy link
Member

use previewOptions.remarkPlugins props. remark plugins

import slug from 'remark-slug'

<MDEditor
  value={value}
  onChange={setValue}
  previewOptions={{
    remarkPlugins: [slug]
  }}
/>

@shajil-t

@shajil-t
Copy link
Author

use previewOptions.remarkPlugins props. remark plugins

import slug from 'remark-slug'

<MDEditor
  value={value}
  onChange={setValue}
  previewOptions={{
    remarkPlugins: [slug]
  }}
/>

Thank you so much for the help, much appreciated, this now works on Editor Preview, however I would like to have this plugin for <MDEditor.Markdown> as well, how can use I use that please?

@jaywcjlove
Copy link
Member

import slug from 'remark-slug'

<MDEditor.Markdown
  previewOptions={{
    remarkPlugins: [slug]
  }}
/>

@shajil-t

@shajil-t
Copy link
Author

import slug from 'remark-slug'

<MDEditor.Markdown
  previewOptions={{
    remarkPlugins: [slug]
  }}
/>

@shajil-t

This doesn't seems to be working, there are no id's for headers when rendered in <MDEditor.Markdown>

@jaywcjlove
Copy link
Member

import slug from 'remark-slug'

<MDEditor.Markdown
  remarkPlugins={[slug]}
/>

@shajil-t

@shajil-t
Copy link
Author

import slug from 'remark-slug'

<MDEditor.Markdown
  remarkPlugins={[slug]}
/>

@shajil-t

This works 👍 Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants