I would like to add a simple markdown to user comments.
When user submits this comment:
I just got [card:Black Lotus] man. POW!
I would like it to be display like this:
I just got Black Lotus man. POW!
but with extra html markup:
I just got <span class="preview" data-card="/cards/card.id">Black Lotus</span> man. POW!
1) I looked at Redcarpet but can't figure out how to add [card:...]
markdown to it.
2) or should I just run regexp and replace content before saving it to DB and then sanitize(ActionView::Helpers::SanitizeHelper)
span
tag before displaying a comment?
preprocess
instead ofnormal_text
, so I'm editing this. If you know something I'm missing, please correct my correction. – Sunfast