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

Disable headings or other specific elements of markdown syntax #782

Open
collimarco opened this issue Oct 17, 2023 · 2 comments
Open

Disable headings or other specific elements of markdown syntax #782

collimarco opened this issue Oct 17, 2023 · 2 comments

Comments

@collimarco
Copy link

I have a text field in markdown, but I don't want to allow the use of headings (h1, h2, etc.).

Is it possible to disable headings recognition in redcarpet?

Is it possible to selectively enable what parts of the markdown syntax we want to allow? (e.g. allow: "bold", "italic", "list", "link" and nothing else).

@denkozlovs
Copy link

there're two options:

  • create your own renderer
  • apply sanitize from sanitize gem with a list of desired tags

@ohboyd
Copy link

ohboyd commented Oct 22, 2024

@collimarco did you ever end up trying to create your own renderer for this type of behavior?

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

3 participants