1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #2136 from judearasu/guides_branch

notextile tag in rails guides generator has been placed with ascii quotes
This commit is contained in:
Xavier Noria 2011-07-20 04:04:07 -07:00
commit 4636638bb9
2 changed files with 6 additions and 4 deletions

View file

@ -227,13 +227,13 @@ module RailsGuides
end
code_blocks.push(<<HTML)
<notextile>
&lt;notextile&gt;
<div class="code_container">
<pre class="brush: #{brush}; gutter: false; toolbar: false">
#{ERB::Util.h($2).strip}
</pre>
</div>
</notextile>
&lt;/notextile&gt;
HTML
"\ndirty_workaround_for_notextile_#{code_blocks.size - 1}\n"
end
@ -280,3 +280,4 @@ HTML
end
end
end

View file

@ -25,7 +25,7 @@ module RailsGuides
def plusplus(body)
body.gsub!(/\+(.*?)\+/) do |m|
"<notextile><tt>#{$1}</tt></notextile>"
"&lt;notextile&gt;<tt>#{$1}</tt>&lt;/notextile&gt;"
end
# The real plus sign
@ -36,8 +36,9 @@ module RailsGuides
body.gsub!(%r{<(yaml|shell|ruby|erb|html|sql|plain)>(.*?)</\1>}m) do |m|
es = ERB::Util.h($2)
css_class = $1.in?(['erb', 'shell']) ? 'html' : $1
%{<notextile><div class="code_container"><code class="#{css_class}">#{es}</code></div></notextile>}
%{&lt;notextile&gt;<div class="code_container"><code class="#{css_class}">#{es}</code></div>&lt;/notextile&gt;}
end
end
end
end