diff options
author | Ralph Amissah <ralph@amissah.com> | 2011-10-31 22:07:13 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2011-10-31 22:07:13 -0400 |
commit | aab1394b01154c9b1f86b863d48e1752f635f6b3 (patch) | |
tree | 79a9da9a104f5d68e1b394bbc5de07ab2363f960 /lib/sisu/v3/param.rb | |
parent | debian/changelog (3.1.1-1) (diff) | |
parent | v3: header, bold & italic pattern matching, ignore case (possibility reinstated) (diff) |
Merge commit 'sisu_3.1.2' into debian/sid
Diffstat (limited to 'lib/sisu/v3/param.rb')
-rw-r--r-- | lib/sisu/v3/param.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/sisu/v3/param.rb b/lib/sisu/v3/param.rb index 674b8cba..37ffeea7 100644 --- a/lib/sisu/v3/param.rb +++ b/lib/sisu/v3/param.rb @@ -774,26 +774,26 @@ module SiSU_Param end def bold m=@h['bold'] - x=(m=~/\/i$/)? 'i' : '' + i=(m=~/\/i$/)? 'i' : '' z=if m - m.gsub!(/^\/(.+?)\/i?/,'\1') - m.gsub!(/\(/,'(?:') # avoid need to escape use of brackets within regex provided + x=m.gsub(/^\/(.+?)\/i?/,'\1') + x.gsub!(/\(/,'(?:') # avoid need to escape use of brackets within regex provided rgx='\b(' + m + ')\b' - y=((x =~/i/) ? (/#{rgx}/i) : (/#{rgx}/)) - { str: '\b(?:' + m + ')\b', regx: y } + y=((i =~/i/) ? (/#{rgx}/i) : (/#{rgx}/)) + { str: '\b(?:' + m + ')\b', regx: y, i: i } else nil end z end def italics m=@h['italics'] - x=((m=~/\/i$/) ? 'i' : '') + i=((m=~/\/i$/) ? 'i' : '') z=if m - m.gsub!(/^\/(.+?)\/i?/,'\1') - m.gsub!(/\(/,'(?:') # avoid need to escape use of brackets within regex provided + x=m.gsub(/^\/(.+?)\/i?/,'\1') + x.gsub!(/\(/,'(?:') # avoid need to escape use of brackets within regex provided rgx='\b(' + m + ')\b' - y=((x =~/i/) ? (/#{rgx}/i) : (/#{rgx}/)) - { str: '\b(?:' + m + ')\b', regx: y } + y=((i =~/i/) ? (/#{rgx}/i) : (/#{rgx}/)) + { str: '\b(?:' + m + ')\b', regx: y, i: i } else nil end z |