aboutsummaryrefslogtreecommitdiffstats
path: root/guides/rails_guides/markdown/renderer.rb
diff options
context:
space:
mode:
Diffstat (limited to 'guides/rails_guides/markdown/renderer.rb')
-rw-r--r--guides/rails_guides/markdown/renderer.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/guides/rails_guides/markdown/renderer.rb b/guides/rails_guides/markdown/renderer.rb
index 9d43c10be6..78820a7856 100644
--- a/guides/rails_guides/markdown/renderer.rb
+++ b/guides/rails_guides/markdown/renderer.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module RailsGuides
class Markdown
class Renderer < Redcarpet::Render::HTML
@@ -73,7 +75,7 @@ HTML
#
# It is important that we do not eat more than one newline
# because formatting may be wrong otherwise. For example,
- # if a bulleted list follows the first item is not rendered
+ # 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
@@ -93,7 +95,7 @@ HTML
def github_file_url(file_path)
tree = version || edge
- root = file_path[%r{(.+)/}, 1]
+ root = file_path[%r{(\w+)/}, 1]
path = \
case root
when "abstract_controller", "action_controller", "action_dispatch"