Questions tagged [redcarpet]

Redcarpet is a Ruby library for Markdown processing

Redcarpet is a Ruby library for Markdown processing, written by Vicent Martí. Check the code and docs on its Github page.

136 questions
1
vote
1 answer

Redcarpet for Jekyll (GithubPages) does not work

I'm trying to set up syntax highlighting for my Jekyll page using redcarpet but I can't get it to work. If I try it out I always see that still rogue is being used. This is how my _config.yml looks like: redcarpet: extensions:…
Adam Arold
  • 29,285
  • 22
  • 112
  • 207
1
vote
0 answers

Issue with Red Carpet gem recognizing markdown text from bootsy gem

I am new to Ruby on rails and am currently working on a project that is similar to stack overflow in the sense that users will be able to ask questions and submit answers in regard to coding. I have recently installed the bootsy gem to make a nice…
Jake25k
  • 19
  • 1
1
vote
1 answer

How to make Redcarpet optionally filter HTML tags?

I would like to whitelist some HTML tags, for example so that I can show pretty keyboard icon for all keyboard shortcuts. How can I do this? The code snippet below is the function I currently used to convert Markdown string into HTML. …
XY L
  • 25,431
  • 14
  • 84
  • 143
1
vote
2 answers

Rails - images with Redcarpet

I'm writing a Rails application and have articles in Markdown rendered using the Redcarpet gem. I would like to include images in my articles, how would I go about doing this? Where is the correct place for the images in my application, and how…
Alex
  • 49
  • 9
1
vote
1 answer

CSS label line numbers without pre-splitting lines into divs/list (output of Jekyll + Redcarpet + Pygments)

There's a lot of results on Google for CSS-based line numbering for code samples. Unfortunately, it seems all of them assume that you have your individual lines of code in separate divs or lis. Is there an alternative technique for the case where…
Ming
  • 1,613
  • 12
  • 27
1
vote
0 answers

Prevent injection attack form Redcarpet gem in rails

I have a text area that allows user to type in description of their cars. It is saved as :text and when called, I will render via the ApplicationHelper as below: module ApplicationHelper def markdown(text) renderer =…
Chris Yeung
  • 2,613
  • 6
  • 34
  • 57
1
vote
1 answer

Using Redcarpet with rails 4

I installed Redcarpet. I was following 272 Railscast tutorial on how to use it. I have this line in my show.html.erb <%= Redcarpet.new(@topic.text).to_html %> My rails app doesn't seem to know there's Redcarpet. I gives a NoMethodError:…
bodyfarmer
  • 402
  • 1
  • 7
  • 17
1
vote
1 answer

Daring fireball: List markdown not working

I am using redcarpet to render my markdown text. here is the function I am using: def markdown(text) render_options = { hard_wrap: true, filter_html: true } markdown_options = { autolink: true, no_intra_emphasis: true } markdown =…
sonalkr132
  • 967
  • 1
  • 9
  • 25
1
vote
2 answers

Implementing preview for markdown text

I am working on Ruby on Rails project and I have implemented markdown syntax for some text descriptions in my project using redcarpet gem. It works like charm allowing to convert markdown text to HTML as simply as <%= markdown some_text_variable…
zavg
  • 10,351
  • 4
  • 44
  • 67
1
vote
0 answers

Rails: Redcarpet markdown and auto_html conflict

I am working on an app that allows users to input youtube videos, images, tweets, etc. To accomplish that I used auto_html(https://github.com/dejan/auto_html) and the code works fine. I am now trying to implement redcarpet markdown but whenever I…
Gabriel Ferraz
  • 592
  • 6
  • 26
1
vote
0 answers

Redcarpet + Pygments - Multiline Error

I followed this Railscast to try to incorporate syntax highlighting and markdown in my Rails app: http://railscasts.com/episodes/207-syntax-highlighting-revised?view=asciicast But for some reason, it's only applying formatting to single line…
scientiffic
  • 9,045
  • 18
  • 76
  • 149
1
vote
1 answer

Markdown and external links

I have a Rails 4 app (which uses RedCarpet) and a helper method that looks like: def markdown(text) options = { escape_html: true, hard_wrap: true, link_attributes: { rel: 'nofollow', target: "_blank" }, …
the_
  • 1,183
  • 2
  • 30
  • 61
1
vote
2 answers

How to render images in my Rails app using markdown and the Redcarpet Gem?

I'm creating a blog in rails and I decided to use Redcarpet to generate blog content in markdown. The problem is I can't get my images to render. I've tried the following markdown syntax: ![test](/image.png) I've also tried using html image tags:…
Patrick G.
  • 697
  • 7
  • 13
1
vote
1 answer

Jekyll + redcarpet line numbers

I set up a Jekyll blog and I have the following config for syntax highlighting. markdown: redcarpet highlighter: pygments This allows me to add syntax highlighting like this: ```javascript function blah(){ } ``` Is there any way to keep this…
GGhe
  • 663
  • 5
  • 17
1
vote
0 answers

How to use rails method in .js.erb and pass it javascript argument?

I have a .js.erb file and I'm trying to make it possible to write comments. I have two tabs: write and preview. When you click on 'preview' tab, markdown preview should be displayed. Now, I'm using Redcarpet and stuff from RailsCast272, so my…
ivanacorovic
  • 2,669
  • 4
  • 30
  • 46