<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Rails Forum - Ruby on Rails Help and Discussion Forum - Redcarpet and coderay- regular expression help]]></title>
		<link>http://railsforum.com/viewtopic.php?id=47715</link>
		<description><![CDATA[The most recent posts in Redcarpet and coderay- regular expression help.]]></description>
		<lastBuildDate>Sat, 28 Jan 2012 17:23:59 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Redcarpet and coderay- regular expression help]]></title>
			<link>http://railsforum.com/viewtopic.php?pid=149038#p149038</link>
			<description><![CDATA[<p>I am trying to use redcarpet and code ray together. I was followed <a href="http://railscasts.com/episodes/272-markdown-with-redcarpet">Railscasts #272 Markdown with Redcarpet</a>. However, I do not want to use Pygments for syntax highlighting due to issues with heroku. A gem solution would be much better, so I followed <a href="http://railscasts.com/episodes/207-syntax-highlighting">Railscasts #207 Syntax Highlighting</a> to implement coderay.</p><p>Here is the helper method provided for coderay:<br /></p><div class="codebox"><pre><code>module ApplicationHelper  
  def coderay(text)
    text.gsub(/\&lt;code( lang=&quot;(.+?)&quot;)?\&gt;(.+?)\&lt;\/code\&gt;/m) do
      CodeRay.scan($3, $2).div(:css =&gt; :class)
    end
  end
end</code></pre></div><p>I am trying to make code blocks use the github style syntax of <span style="color: #FF0000">``` ruby</span> or <span style="color: #FF0000">```ruby</span>.</p><p>I&#039;ve been using <a href="http://rubular.com/">rubular</a> to try to create a regular expression to match ^^^^. Here is what I have so far, but it does not work. Please help me out! Thank you!</p><div class="codebox"><pre><code># regex to match
/`{3}\s?(.*)\n(.*)`{3}/

# test strings
``` ruby
def rubyroo
```

```ruby
def rubyroo
```</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (tuscanidream)]]></author>
			<pubDate>Sat, 28 Jan 2012 17:23:59 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?pid=149038#p149038</guid>
		</item>
	</channel>
</rss>
