Skip to content

Commit f5d5f2e

Browse files
authored
Merge pull request rails#53949 from sikachu/guides-convert-squarebrackets
Convert `[]` in heading to `-squarebrackets` in DOM id
2 parents 096fb3b + f3722be commit f5d5f2e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

guides/rails_guides/markdown.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ def dom_id_text(text)
5555

5656
text.downcase.gsub(/\?/, "-questionmark")
5757
.gsub(/!/, "-bang")
58+
.gsub(/\[\]/, "-squarebrackets")
5859
.gsub(/[#{escaped_chars}]+/, " ").strip
5960
.gsub(/\s+/, "-")
6061
end

0 commit comments

Comments
 (0)