CommonMark.NET icon indicating copy to clipboard operation
CommonMark.NET copied to clipboard

Can you disable features of markdown?

Open ghost opened this issue 9 years ago • 3 comments

I don't want to allow the heading features of markdown for the users.

ghost avatar Feb 13 '16 17:02 ghost

Currently you cannot remove any features specified in CommonMark spec.

Some other options:

See #38 - you could offset the heading levels so that the users cannot create h1, just h3 etc.

If you want to completely remove the heading you would probably have to instead change the Tag value to something like BlockTag.Paragraph.

The other option is to use the formatter extensibility to render something other than h* elements.

Knagis avatar Feb 14 '16 22:02 Knagis

I think that ability to remove a feature, or better yet specify white list of features, would really help Markdown adoption. Basically allow us to easily define a Markdown subset and it can solve a lot of issues related to a perceived 'unsafeness' of Markdown. Common use case - StackOverflow comments section with their 'mini-Markdown' that allows only bold, italic and link.

Blinky32 avatar Sep 26 '16 00:09 Blinky32

Whitelisting features would be really helpful. I'd like to let users use the basic text formatting features (bold, italic, underline, delete) but I don't want the rest (no html, headers, links, images, etc.).

xt0rted avatar Aug 19 '17 22:08 xt0rted