diff options
Diffstat (limited to 'guides/rails_guides/markdown/renderer.rb')
-rw-r--r-- | guides/rails_guides/markdown/renderer.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/guides/rails_guides/markdown/renderer.rb b/guides/rails_guides/markdown/renderer.rb index c3fe5b8799..c1968af64a 100644 --- a/guides/rails_guides/markdown/renderer.rb +++ b/guides/rails_guides/markdown/renderer.rb @@ -23,8 +23,9 @@ HTML end def paragraph(text) - if text =~ /^(TIP|IMPORTANT|CAUTION|WARNING|NOTE|INFO|TODO)[.:](.*?)/ + if text =~ /^(TIP|IMPORTANT|CAUTION|WARNING|NOTE|INFO|TODO)[.:]/ convert_notes(text) + elsif text.include?('DO NOT READ THIS FILE IN GITHUB') elsif text =~ /^\[<sup>(\d+)\]:<\/sup> (.+)$/ linkback = %(<a href="#footnote-#{$1}-ref"><sup>#{$1}</sup></a>) %(<p class="footnote" id="footnote-#{$1}">#{linkback} #{$2}</p>) @@ -50,7 +51,7 @@ HTML when 'erb' 'ruby; html-script: true' when 'html' - 'xml' # html is understood, but there are .xml rules in the CSS + 'xml' # HTML is understood, but there are .xml rules in the CSS else 'plain' end @@ -65,7 +66,7 @@ HTML # if a bulleted list follows the first item is not rendered # as a list item, but as a paragraph starting with a plain # asterisk. - body.gsub(/^(TIP|IMPORTANT|CAUTION|WARNING|NOTE|INFO|TODO)[.:](.*?)(\n(?=\n)|\Z)/m) do |m| + body.gsub(/^(TIP|IMPORTANT|CAUTION|WARNING|NOTE|INFO|TODO)[.:](.*?)(\n(?=\n)|\Z)/m) do css_class = case $1 when 'CAUTION', 'IMPORTANT' 'warning' |