From e746980507ed48e30ab35daf587bf9863d5b9261 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sun, 7 Aug 2011 16:20:31 -0700 Subject: guides generation: apparently this workaround for RedCloth is not needed anymore --- railties/guides/rails_guides/textile_extensions.rb | 25 +++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'railties/guides/rails_guides/textile_extensions.rb') diff --git a/railties/guides/rails_guides/textile_extensions.rb b/railties/guides/rails_guides/textile_extensions.rb index b3e0e32357..4677fae504 100644 --- a/railties/guides/rails_guides/textile_extensions.rb +++ b/railties/guides/rails_guides/textile_extensions.rb @@ -33,11 +33,30 @@ module RailsGuides body.gsub!('', '+') end + def brush_for(code_type) + case code_type + when 'ruby', 'sql', 'plain' + code_type + when 'erb' + 'ruby; html-script: true' + when 'html' + 'xml' # html is understood, but there are .xml rules in the CSS + else + 'plain' + end + end + def code(body) body.gsub!(%r{<(yaml|shell|ruby|erb|html|sql|plain)>(.*?)}m) do |m| - es = ERB::Util.h($2) - css_class = $1.in?(['erb', 'shell']) ? 'html' : $1 - %{
#{es}
} + < +
+
+#{ERB::Util.h($2).strip}
+
+
+ +HTML end end end -- cgit v1.2.3