Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fenced code blocks don't work #28

Open
DasyatidPrime opened this issue Jan 20, 2011 · 8 comments
Open

Fenced code blocks don't work #28

DasyatidPrime opened this issue Jan 20, 2011 · 8 comments

Comments

@DasyatidPrime
Copy link

Supposedly Maruku supports the features from Markdown Extra, and they appear to be enabled by default. On that page, however, there is a description of “fenced code blocks” which are activated by lines of tildes. These don't seem to get translated by Maruku:

$ irb1.9.1
irb(main):001:0> require 'maruku'
=> true
irb(main):005:0> Maruku.new("foo\n\n~~~~\nfoo\n~~~~").to_html
=> "<p>foo</p>\n\n<p>~~~~ foo ~~~~</p>"

It's possible I'm missing some way of enabling these, but a few quick greps of the source turned up nothing.

@distler
Copy link
Collaborator

distler commented Aug 27, 2011

Correct. The extension is not enabled here.

It is, in my Nokogiri branch.

@cboettig
Copy link

cboettig commented May 3, 2012

Any hints on how to enable Maruku with support for fenced code blocks in Jekyll (intelligible to a non-ruby-developer)? To start, how do I install the gem corresponding to the Nokogiri branch?

@distler
Copy link
Collaborator

distler commented May 3, 2012

I don't know how to do that from Rubgems, but Bundler handles that task just fine.

@cboettig
Copy link

cboettig commented May 3, 2012

Thanks for the link, just installed the bundler gem. I'm a bit dense, looks like I need to run

gem "maruku", :git => "https://github.com/distler/maruku.git" :branch => "nokogiri"

to use your github branch for the Maruku gem. I tried running that command from the command line and bash just gets confused. How was I supposed to have done it?

@cboettig
Copy link

cboettig commented May 3, 2012

@distler I cloned your Nokogiri branch and ran bundle install successfully to install it. Running Jekyll with Maruku as the interpreter, I still do not get fenced code blocks like ~~~ or

 ```xml 
 <?xml version="1.0" encoding="UTF-8"?>

to display properly. Perhaps I haven't convinced it to use the right version of maruku? Have I missed something?

@distler
Copy link
Collaborator

distler commented May 4, 2012

I believe that you need at least five '~'s to signal the start of a fenced codeblock, and an equal (or larger) number to end one.

@bhollis
Copy link
Owner

bhollis commented Sep 16, 2012

We should support three-backtick fenced code blocks as well.

@bhollis
Copy link
Owner

bhollis commented Oct 19, 2013

Fenced code blocks (tildes and backticks) can be enabled in 0.7.0 using the :fenced_code_blocks setting. This ticket is still open to turn them on by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants