aboutsummaryrefslogtreecommitdiffstats
path: root/guides/rails_guides/markdown
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2016-08-06 19:21:59 +0200
committerXavier Noria <fxn@hashref.com>2016-08-06 19:21:59 +0200
commit6b3719b7577ab81171bab94a0492ae383dd279fe (patch)
treedda0bb85b771cafd16acf5bea1288233feca8e09 /guides/rails_guides/markdown
parent8b4e6bf23338e2080af537ea4f295e65a1d11388 (diff)
downloadrails-6b3719b7577ab81171bab94a0492ae383dd279fe.tar.gz
rails-6b3719b7577ab81171bab94a0492ae383dd279fe.tar.bz2
rails-6b3719b7577ab81171bab94a0492ae383dd279fe.zip
applies new string literal convention in guides
The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
Diffstat (limited to 'guides/rails_guides/markdown')
-rw-r--r--guides/rails_guides/markdown/renderer.rb22
1 files changed, 11 insertions, 11 deletions
diff --git a/guides/rails_guides/markdown/renderer.rb b/guides/rails_guides/markdown/renderer.rb
index 73ca600361..ec858460e8 100644
--- a/guides/rails_guides/markdown/renderer.rb
+++ b/guides/rails_guides/markdown/renderer.rb
@@ -25,7 +25,7 @@ HTML
def paragraph(text)
if text =~ /^(TIP|IMPORTANT|CAUTION|WARNING|NOTE|INFO|TODO)[.:]/
convert_notes(text)
- elsif text.include?('DO NOT READ THIS FILE ON GITHUB')
+ elsif text.include?("DO NOT READ THIS FILE ON 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>)
@@ -46,14 +46,14 @@ HTML
def brush_for(code_type)
case code_type
- when 'ruby', 'sql', 'plain'
+ when "ruby", "sql", "plain"
code_type
- when 'erb', 'html+erb'
- 'ruby; html-script: true'
- when 'html'
- 'xml' # HTML is understood, but there are .xml rules in the CSS
+ when "erb", "html+erb"
+ "ruby; html-script: true"
+ when "html"
+ "xml" # HTML is understood, but there are .xml rules in the CSS
else
- 'plain'
+ "plain"
end
end
@@ -68,10 +68,10 @@ HTML
# asterisk.
body.gsub(/^(TIP|IMPORTANT|CAUTION|WARNING|NOTE|INFO|TODO)[.:](.*?)(\n(?=\n)|\Z)/m) do
css_class = case $1
- when 'CAUTION', 'IMPORTANT'
- 'warning'
- when 'TIP'
- 'info'
+ when "CAUTION", "IMPORTANT"
+ "warning"
+ when "TIP"
+ "info"
else
$1.downcase
end