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
3
votes
1 answer

How to detect code language for markdown?

I've written in a textarea: ```ruby puts 'hello word!' ``` I won't get:
puts hello word!
Instead I got: puts hello word! I tried different attributes. My helper: def markdown(text) renderer =…
Vladimir
  • 67
  • 5
3
votes
1 answer

How to extend Middleman's Redcarpet markdown renderer?

I am building a site with Middleman, and using Redcarpet as my markdown engine, mostly for its GFM support. I would like to tap into or precede the markdown rendering process to add support for various syntax options. In one example, I'd like…
seancdavis
  • 2,739
  • 2
  • 26
  • 36
3
votes
3 answers

Redcarpet Syntax Highlighting

I'm trying to get Syntax Highlighting with Redcarpet working My appliaction_helper.rb: module ApplicationHelper def markdown(text) render_options = { # will remove from the output HTML tags inputted by user filter_html: …
Mini John
  • 7,855
  • 9
  • 59
  • 108
3
votes
1 answer

Not able to get line breaks using redcarpet

I am not able to get a line break
, even if there is a line with spaces and newline in the content. Is there any way this can enabled in redcarpet. http://daringfireball.net/projects/markdown/syntax#p "When you do want to insert a break tag…
Srikan
  • 2,161
  • 5
  • 21
  • 36
3
votes
1 answer

Rails/Redcarpet: Markdown-->HTML with link attributes not working in helper

I've got a function in my ApplicationHelper, as well as an exact duplicate in a controller for prerendering. Prerendering creates the links the way I want, with target="_blank", but rendering on the spot does not. My code is as follows: require…
w2bro
  • 1,016
  • 1
  • 11
  • 36
3
votes
1 answer

Is it possible to extend Redcarpet to auto embed youtube videos from a link?

Is it possible to use the Redcarpet Markdown library to automatically embed youtube videos from youtube share links? If so anyone got any ideas on how to go about it? (I'm using Ruby/Rails 3.2)
A4J
  • 879
  • 10
  • 24
2
votes
1 answer

Has anyone figured out how to embed video using the Redcarpet gem for Markdown in Rails 3.2?

Wondering if anyone has a good solution for this. My app is displaying nothing when embedding both the old and new version of YouTube's video embed code. I'm using GitHub's Markdown Gem Redcarpet, and it doesn't appear that there is any information…
bgadoci
  • 6,363
  • 17
  • 64
  • 91
2
votes
2 answers

How do I pass an extension to the Redcarpet Nanoc filter

I'm trying to filter content in Nanoc 3 using their :redcarpet filter. My code looks like the following (from the Rules file): compile '/posts/*/' do filter :redcarpet layout 'default' end I want to pass the option :fenced_code_blocks to…
Clueless
  • 3,984
  • 1
  • 20
  • 27
2
votes
2 answers

How to remove the end slash from the img tag?

Kramdown is now the default markdown renderer for Jekyll 4.0. I would like to know if there is a way to remove the end slash from the img tag. For example: ![Flowers](flowers.jpg) Flowers One way until a few months…
2
votes
1 answer

Redcarpet isn't rendering markdown inside HTML tags. Is this normal, and can it be overridden?

I/ve written a simple Rails helper to convert Markdown using Redcarpet. Here's the code: def markdown(text) render_options = { filter_html: false, hard_wrap: true, link_attributes: { rel: 'nofollow' } } renderer =…
jeffpatt
  • 237
  • 1
  • 2
  • 9
2
votes
2 answers

What is the difference between " ’ " and " ' "

For some reason Redcarpet markdown renders ' as ' while rendering ’ as ’. Are there two types of single quote? Why would Redcarpet treat one differently than the other. (Ascii table seems to have one, but under unicode I'm assuming there are…
Reza Shirazian
  • 2,303
  • 1
  • 22
  • 30
2
votes
1 answer

Syntaxhighlighting with Redcarpet and Rouge does not work in Rails 5 app

Does anyone have experience with the Redcarpet and Rouge gems for Rails? I'm trying to use the gems for syntaxhighlighting in my blogapplication. I based my implementation on this blogpost: http://www.brettdemetris.com/posts/4 These are the steps I…
Toontje
  • 1,415
  • 4
  • 25
  • 43
2
votes
1 answer

Markdown external image links with Redcarpet

I am using the redcarpet gem to markdown user generated text and would like to show images of external links/image hosts. So far, I have tried something like this: def markdown(text) options = { ... } extension = { ... } …
D. v. Baboon
  • 53
  • 1
  • 7
2
votes
1 answer

syntax error, unexpected ')', expecting '='

I'm writing an extension for Redcarpet for a Jekyll-powered website. I want to use {x|y} as a tag in markdown that evaluates to the HTML tag (and its associates). I wrote this class as per Jekyll's guide, Redcarpet's guide, and this guide on…
HotelCalifornia
  • 317
  • 5
  • 16
2
votes
0 answers

Jekyll and Redcarpet (plus dependencies)

Up until a few hours ago, I had my jekyll install working as normal. Having created 26 different posts using my current setup, I'm not expecting something to suddenly not work at all. Ran jekyll build to see the results of a new post I created for…
Dipet
  • 323
  • 3
  • 14
1 2
3
9 10