Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6003611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:08:46+00:00 2026-05-23T01:08:46+00:00

Is it possible to limit the set of allowed tags when using RDiscount ?

  • 0

Is it possible to limit the set of allowed “tags” when using RDiscount?
Let’s say I want to prevent the user from creating lists e.g.? Or only allow bold and italic tags?

And if not, can this be done using e.g. BlueCloth or some other parser?

UPDATE

I’m for now using GFM via redcarpet and after reading How can I restrict Markdown syntax in Ruby? I’ve added Sanitize to strip out some of the tags Redcarpet generates. This solution works somewhat okay, but requires some nasty workarounds in cases.

In this sense — I’m still very much looking for a better solution!

Cheers!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T01:08:47+00:00Added an answer on May 23, 2026 at 1:08 am

    Since it seems that there’s no “baked–in” solution for this, so here’s my work–around using Redcarpet and Sanitize:

    markdown = Redcarpet.new(:smart, :filter_html, :hard_wrap)
    sanitize_options = {
      :elements => %w(a strong em code pre br sub sup strike small)
    }
    html = Sanitize.clean(markdown.to_html, sanitize_options).html_safe
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible using CAML to limit the amount of results returned. Say for
Is it possible to set the stack limit in DevC++? Basically the same as
Is it possible to let MySQL LIMIT have an offset of the total number
Is it possible to limit the set of characters that tesseract is looking for
Is it possible to limit the number of rows that are updated using Hibernate/HQL?
Is it possible to set a memory limit specifically to a variable ? (This
Is it possible to set limit to multipleselect? Below is an example code where
Is it possible to set a limit on Dir.each method? I would like to
Possible Duplicate: limit number of characters entered in textarea How can I set a
I have a textfield that I want to set a limit, not the digit

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.