Skip to content

Commit

Permalink
in textile extensions, simplify regexp literal, and remove spurious e…
Browse files Browse the repository at this point in the history
…xtra newline in code blocks
  • Loading branch information
fxn committed Feb 28, 2009
1 parent da5549b commit 5257ea7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions railties/guides/rails_guides/textile_extensions.rb
Expand Up @@ -31,10 +31,10 @@ def plusplus(body)
end

def code(body)
body.gsub!(/\<(yaml|shell|ruby|erb|html|sql)\>(.*?)\<\/\1\>/m) do |m|
body.gsub!(%r{<(yaml|shell|ruby|erb|html|sql)>(.*?)</\1>}m) do |m|
es = ERB::Util.h($2)
css_class = ['erb', 'shell'].include?($1) ? 'html' : $1
%{<notextile><div class="code_container"><code class="#{css_class}">#{es}\n</code></div></notextile>}
%{<notextile><div class="code_container"><code class="#{css_class}">#{es}</code></div></notextile>}
end
end
end
Expand Down

0 comments on commit 5257ea7

Please sign in to comment.