diff options
author | Ralph Amissah <ralph@amissah.com> | 2011-10-31 21:59:00 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2011-10-31 21:59:04 -0400 |
commit | da4acc732746fef2af1759e64574c9e376966057 (patch) | |
tree | 2d80947bbfaad2cbccceda79aef562bde168deb7 /lib | |
parent | v3: sysenv, skins, a fix (diff) |
v3: header, bold & italic pattern matching, ignore case (possibility reinstated)sisu_3.1.2
* (bold & italic pattern matching) @make: :bold: :italic: /[regex]/i
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sisu/v3/dal_syntax.rb | 12 | ||||
-rw-r--r-- | lib/sisu/v3/param.rb | 20 |
2 files changed, 16 insertions, 16 deletions
diff --git a/lib/sisu/v3/dal_syntax.rb b/lib/sisu/v3/dal_syntax.rb index a412ef3d..3a943b75 100644 --- a/lib/sisu/v3/dal_syntax.rb +++ b/lib/sisu/v3/dal_syntax.rb @@ -97,11 +97,11 @@ module SiSU_Syntax ital_line=%{^/_\s.+?(?:#{Mx[:br_line]}|\n|$)} @line_scan_ital=if defined? @md.make.italics[:str] \ and defined? @vz.markup_make_italic[:str] - /#{@http_m}|#{bold_line}|#{@manmkp_ital}#{tail_m_ital}|(?:#{@md.make.italics[:str]}|#{@vz.markup_make_italic[:str]})#{tail_m_ital}|\S+|\n/ + /#{@http_m}|#{bold_line}|#{@manmkp_ital}#{tail_m_ital}|(?:#{@md.make.italics[:str]}|#{@vz.markup_make_italic[:str]})#{tail_m_ital}|\S+|\n/i elsif defined? @md.make.italics[:str] - /#{@http_m}|#{bold_line}|#{@manmkp_ital}#{tail_m_ital}|#{@md.make.italics[:str]}#{tail_m_ital}|\S+|\n/ + /#{@http_m}|#{bold_line}|#{@manmkp_ital}#{tail_m_ital}|#{@md.make.italics[:str]}#{tail_m_ital}|\S+|\n/i elsif defined? @vz.markup_make_italic[:str] - /#{@http_m}|#{bold_line}|#{@manmkp_ital}#{tail_m_ital}|#{@vz.markup_make_italic[:str]}#{tail_m_ital}|\S+|\n/ + /#{@http_m}|#{bold_line}|#{@manmkp_ital}#{tail_m_ital}|#{@vz.markup_make_italic[:str]}#{tail_m_ital}|\S+|\n/i end @manmkp_bold=emph_italics \ ? '^!_\s.+?(?:\n|$)|[!b]\\{.+?\\}[*!b]|[*!][a-zA-Z0-9\-_]+[!]' @@ -110,13 +110,13 @@ module SiSU_Syntax and @md.make.bold[:str]) \ and (defined? @vz.markup_make_bold[:str] \ and @vz.markup_make_bold[:str]) - /#{@http_m}|#{bold_line}|(?:#{@manmkp_bold}|#{@md.make.bold[:str]}|#{@vz.markup_make_bold[:str]})#{tail_m_bold}|\S+|\n/ + /#{@http_m}|#{bold_line}|(?:#{@manmkp_bold}|#{@md.make.bold[:str]}|#{@vz.markup_make_bold[:str]})#{tail_m_bold}|\S+|\n/i elsif defined? @md.make.bold[:str] \ and @md.make.bold[:str] - /#{@http_m}|#{bold_line}|(?:#{@manmkp_bold}|#{@md.make.bold[:str]})#{tail_m_bold}|\S+|\n/ + /#{@http_m}|#{bold_line}|(?:#{@manmkp_bold}|#{@md.make.bold[:str]})#{tail_m_bold}|\S+|\n/i elsif defined? @vz.markup_make_bold[:str] \ and @vz.markup_make_bold[:str] - /#{@http_m}|#{bold_line}|(?:#{@manmkp_bold}|#{@vz.markup_make_bold[:str]})#{tail_m_bold}|\S+|\n/ + /#{@http_m}|#{bold_line}|(?:#{@manmkp_bold}|#{@vz.markup_make_bold[:str]})#{tail_m_bold}|\S+|\n/i end end def songsheet 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 |