From f35187be2218cc5f6b5a454f2dffce1cd6bbe8a0 Mon Sep 17 00:00:00 2001 From: Prem Sichanugrist Date: Sun, 2 Sep 2012 14:53:01 -0400 Subject: [PATCH] Make sure that styles in NOTE block got converted --- guides/rails_guides/markdown/renderer.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/guides/rails_guides/markdown/renderer.rb b/guides/rails_guides/markdown/renderer.rb index ec0688f937a..d76ec53b34c 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 -
 #{ERB::Util.h(code).strip}
 
-
HTML end @@ -24,8 +22,12 @@ HTML %(#{text}) 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 + "

#{text}

" + end end private @@ -61,7 +63,7 @@ HTML else $1.downcase end - %Q(

#{$2.strip}

\n) + %(

#{$2.strip}

) end end end