diff options
author | Prem Sichanugrist <s@sikachu.com> | 2012-09-02 14:53:01 -0400 |
---|---|---|
committer | Prem Sichanugrist <s@sikac.hu> | 2012-09-17 15:54:23 -0400 |
commit | f35187be2218cc5f6b5a454f2dffce1cd6bbe8a0 (patch) | |
tree | 4cd503739c2939c94f2ac2271a74609a664ab474 /guides | |
parent | 2e89ac34cf25d1045dcef50d1a03dd84fb37d739 (diff) | |
download | rails-f35187be2218cc5f6b5a454f2dffce1cd6bbe8a0.tar.gz rails-f35187be2218cc5f6b5a454f2dffce1cd6bbe8a0.tar.bz2 rails-f35187be2218cc5f6b5a454f2dffce1cd6bbe8a0.zip |
Make sure that styles in NOTE block got converted
Diffstat (limited to 'guides')
-rw-r--r-- | guides/rails_guides/markdown/renderer.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/guides/rails_guides/markdown/renderer.rb b/guides/rails_guides/markdown/renderer.rb index ec0688f937..d76ec53b34 100644 --- a/guides/rails_guides/markdown/renderer.rb +++ b/guides/rails_guides/markdown/renderer.rb @@ -7,13 +7,11 @@ module RailsGuides def block_code(code, language) <<-HTML -<notextile> <div class="code_container"> <pre class="brush: #{brush_for(language)}; gutter: false; toolbar: false"> #{ERB::Util.h(code).strip} </pre> </div> -</notextile> HTML end @@ -24,8 +22,12 @@ HTML %(<h#{header_level}>#{text}</h#{header_level}>) end - def preprocess(full_document) - convert_notes(full_document) + def paragraph(text) + if text =~ /^(TIP|IMPORTANT|CAUTION|WARNING|NOTE|INFO|TODO)[.:](.*?)/ + convert_notes(text) + else + "<p>#{text}</p>" + end end private @@ -61,7 +63,7 @@ HTML else $1.downcase end - %Q(<div class="#{css_class}"><p>#{$2.strip}</p></div>\n) + %(<div class="#{css_class}"><p>#{$2.strip}</p></div>) end end end |