lib/typogruby.rb in typogruby-1.0.2 vs lib/typogruby.rb in typogruby-1.0.3
- old
+ new
@@ -131,10 +131,10 @@
#
# @param [String] text input text
# @return [String] input text with caps wrapped
def caps(text)
# $1 is an excluded HTML tag, $2 is the part before the caps and $3 is the caps match
- text.gsub(/<(code|pre).+?<\/\1>|(\s| |^|'|"|>)([A-Z\d][A-Z\d\.']{1,})(?!\w)/) do |str|
+ text.gsub(/<(?i)(code|pre)(?-i).+?<(?i)\/\1(?-i)>|(\s| |^|'|"|>)([A-Z\d][A-Z\d\.']{1,})(?!\w)/) do |str|
excluded, before, caps = $1, $2, $3
if excluded
str
elsif $3 =~ /^\d+$/
before + caps
\ No newline at end of file