diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sisu/v2/composite.rb | 2 | ||||
-rw-r--r-- | lib/sisu/v2/dal_doc_str.rb | 2 | ||||
-rw-r--r-- | lib/sisu/v2/dal_syntax.rb | 8 | ||||
-rw-r--r-- | lib/sisu/v2/epub_tune.rb | 2 | ||||
-rw-r--r-- | lib/sisu/v2/html_format.rb | 4 | ||||
-rw-r--r-- | lib/sisu/v2/html_promo.rb | 10 | ||||
-rw-r--r-- | lib/sisu/v2/odf.rb | 6 | ||||
-rw-r--r-- | lib/sisu/v2/param.rb | 2 | ||||
-rw-r--r-- | lib/sisu/v2/remote.rb | 4 | ||||
-rw-r--r-- | lib/sisu/v2/shared_html_lite.rb | 2 | ||||
-rw-r--r-- | lib/sisu/v2/sisupod_make.rb | 2 | ||||
-rw-r--r-- | lib/sisu/v2/texpdf.rb | 2 | ||||
-rw-r--r-- | lib/sisu/v2/texpdf_format.rb | 12 | ||||
-rw-r--r-- | lib/sisu/v2/xml_format.rb | 4 |
14 files changed, 31 insertions, 31 deletions
diff --git a/lib/sisu/v2/composite.rb b/lib/sisu/v2/composite.rb index 44518957..4ff53498 100644 --- a/lib/sisu/v2/composite.rb +++ b/lib/sisu/v2/composite.rb @@ -179,7 +179,7 @@ module SiSU_Assemble if file[:images].length > 0 file[:images].flatten! file[:images].uniq! - file[:images].delete_if {|x| x =~/http:\/\// } + file[:images].delete_if {|x| x =~/https?:\/\// } end file end diff --git a/lib/sisu/v2/dal_doc_str.rb b/lib/sisu/v2/dal_doc_str.rb index e35baf5a..1dc6076e 100644 --- a/lib/sisu/v2/dal_doc_str.rb +++ b/lib/sisu/v2/dal_doc_str.rb @@ -87,7 +87,7 @@ module SiSU_document_structure_extract end end def image_test(str) - boolean=(str=~/\{\s*\S+?\.png.+?\}http:\/\/\S+/ ? true : false) + boolean=(str=~/\{\s*\S+?\.png.+?\}https?:\/\/\S+/ ? true : false) end def bullet_test(str) bool=((str=~/\*/) ? true : false) diff --git a/lib/sisu/v2/dal_syntax.rb b/lib/sisu/v2/dal_syntax.rb index 07186d67..0b7c6541 100644 --- a/lib/sisu/v2/dal_syntax.rb +++ b/lib/sisu/v2/dal_syntax.rb @@ -87,7 +87,7 @@ module SiSU_Syntax {:o =>Mx[:fa_underscore_o], :c =>Mx[:fa_underscore_c] } else p __LINE__.to_s + '::' + __FILE__ end - @http_m=%r{\{.+?\}https?://\S+|https?:\S+|\.\.\/\S+|\S+?\.png\b|[*]~\S+|^#{Mx[:meta_o]}.+|#{Mx[:gr_o]}(?:code|group|alt|verse)(?:-end)?#{Mx[:gr_c]}|#{Mx[:fa_o]}:br#{Mx[:fa_c]}} + @http_m=%r{\{.+?\}https?://\S+|https?:\S+|:\S+|\.\.\/\S+|#\S+|\S+?\.png\b|[*]~\S+|^#{Mx[:meta_o]}.+|#{Mx[:gr_o]}(?:code|group|alt|verse)(?:-end)?#{Mx[:gr_c]}|#{Mx[:fa_o]}:br#{Mx[:fa_c]}} @manmkp_ital=emph_italics \ ? '[i/*]\\{.+?\\}[i/*]' \ : '[i/]\\{.+?\\}[i/]' @@ -166,9 +166,9 @@ module SiSU_Syntax dob end def embolden(given) - given.gsub!(/^!_\s+((?:\{|#{Mx[:lnk_o]})(?:~^ )?.+?(?:\}|#{Mx[:lnk_o]})http:\/\/\S+.*?)(<br>|[#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}])/, + given.gsub!(/^!_\s+((?:\{|#{Mx[:lnk_o]})(?:~^ )?.+?(?:\}|#{Mx[:lnk_o]})https?:\/\/\S+.*?)(<br>|[#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}])/, "#{Mx[:fa_bold_o]} \\1 #{Mx[:fa_bold_c]}\\2") - given.gsub!(/^!_\s+((?:\{|#{Mx[:lnk_o]})(?:~^ )?.+?(?:\}|#{Mx[:lnk_o]})http:\/\/\S+.*)/, + given.gsub!(/^!_\s+((?:\{|#{Mx[:lnk_o]})(?:~^ )?.+?(?:\}|#{Mx[:lnk_o]})https?:\/\/\S+.*)/, "#{Mx[:fa_bold_o]} \\1 #{Mx[:fa_bold_c]}") given.gsub!(/(?:^!_|^#{Mx[:lv_o]}[7-9]:\S*?#{Mx[:lv_c]})\s*(.+?)(<br>|[#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}])/, "#{Mx[:fa_bold_o]}\\1#{Mx[:fa_bold_c]}\\2") @@ -267,7 +267,7 @@ module SiSU_Syntax word=dob.obj.scan(/\S+|\n/) #unless line =~/^(?:#{Mx[:meta_o]}|%+\s)/ #visit if word word.each do |w| # _ - / # | : ! ^ ~ - unless w =~/~\{|\}~|~\[|\]~|^\^~|~\^|\*~\S+|~#|\{t?~|\{table|http:\/\/\S+/ # do something earlier about table!! + unless w =~/~\{|\}~|~\[|\]~|^\^~|~\^|\*~\S+|~#|\{t?~|\{table|https?:\/\/\S+/ # do something earlier about table!! w.gsub!(/\\?~/,"#{Mx[:gl_o]}#126#{Mx[:gl_c]}") #escaped special character end w.gsub!(/^\<$/,"#{Mx[:gl_o]}#lt#{Mx[:gl_c]}") #escaped special character diff --git a/lib/sisu/v2/epub_tune.rb b/lib/sisu/v2/epub_tune.rb index 9115a14d..035a453b 100644 --- a/lib/sisu/v2/epub_tune.rb +++ b/lib/sisu/v2/epub_tune.rb @@ -297,7 +297,7 @@ module SiSU_EPUB_Tune u.gsub!(/^:/,"#{@env.url.root}/") elsif u =~/^\.\.\// u.gsub!(/^\.\.\//,"#{@env.url.root}/") - elsif u =~/http:\/\// + elsif u =~/https?:\/\// else p "NOT FOUND name_tags: #{u}" end ins=%{<a href="#{u}">#{link}</a>} diff --git a/lib/sisu/v2/html_format.rb b/lib/sisu/v2/html_format.rb index 00706192..b3712690 100644 --- a/lib/sisu/v2/html_format.rb +++ b/lib/sisu/v2/html_format.rb @@ -408,7 +408,7 @@ WOK end end def links_guide_vertical_open #??? - url=((defined? @vz.url_hp) && @vz.url_hp =~/^http:\/\/\S+$/ ? @vz.url_hp : @vz.url_home) + url=((defined? @vz.url_hp) && @vz.url_hp =~/^https?:\/\/\S+$/ ? @vz.url_hp : @vz.url_home) %{ <div id="vertical_links"> <ul id="vertical"> @@ -428,7 +428,7 @@ WOK <!- quick ref -!>} end def links_guide_horizontal_open #??? - url=((defined? @vz.url_hp) && @vz.url_hp =~/^http:\/\/\S+$/ ? @vz.url_hp : @vz.url_home) + url=((defined? @vz.url_hp) && @vz.url_hp =~/^https?:\/\/\S+$/ ? @vz.url_hp : @vz.url_home) %{ <div id="horizontal_links"> <ul id="horizontal"> diff --git a/lib/sisu/v2/html_promo.rb b/lib/sisu/v2/html_promo.rb index 92ea15ec..0b3e500a 100644 --- a/lib/sisu/v2/html_promo.rb +++ b/lib/sisu/v2/html_promo.rb @@ -154,10 +154,10 @@ module SiSU_HTML_promo : "#{Db[:name_prefix]}#{@prod['db']}" else nil end - action=if @prod['action']=~/^http:\/\// + action=if @prod['action']=~/^https?:\/\// @prod['action'] elsif defined? @rc['search']['sisu']['action'] \ - and @rc['search']['sisu']['action'] =~/^http:\/\// + and @rc['search']['sisu']['action'] =~/^https?:\/\// @rc['search']['sisu']['action'] else nil end @@ -169,7 +169,7 @@ module SiSU_HTML_promo end def search_form_hyperestraier(table=true) action=if defined? @rc['search']['hyperestraier']['action'] \ - and @rc['search']['hyperestraier']['action'] =~/^http:\/\// + and @rc['search']['hyperestraier']['action'] =~/^https?:\/\// @rc['search']['hyperestraier']['action'] else nil end @@ -187,7 +187,7 @@ module SiSU_HTML_promo and x['url'] \ and x['title'] subtitle=x['subtitle'] ? %{ - #{x['subtitle']}} : '' - url_=(x['url'] =~/http:/) ? x['url'] : "../#{x['url']}" + url_=(x['url'] =~/https?:/) ? x['url'] : "../#{x['url']}" links_a << %{<p class="pane_link"><a href="#{url_}">#{x['title']}#{subtitle}</a></p>\n} end end @@ -199,7 +199,7 @@ module SiSU_HTML_promo @prod['image'] ? %{<img border="0" src="../_sisu/image/#{@prod['image']}" /><br />} : '' end def url_link - @url_=if @prod['url'] =~/http:/ + @url_=if @prod['url'] =~/https?:/ "#{@prod['url']}" else "../#{@prod['url']}" # "#{@env.url.root}/#{@prod['url']}" end diff --git a/lib/sisu/v2/odf.rb b/lib/sisu/v2/odf.rb index 24f45f50..a7c77639 100644 --- a/lib/sisu/v2/odf.rb +++ b/lib/sisu/v2/odf.rb @@ -238,7 +238,7 @@ module SiSU_ODF url.gsub!(/(\\\+)/,'+') #this is convoluted, and risky :-( map_nametags=SiSU_Particulars::Combined_singleton.instance.get_map_nametags(@md).nametags_map t=case url - when /^http:/ + when /^https?:/ %{<text:a xlink:type="simple" xlink:href="#{url}">#{txt.strip}</text:a>#{trail}} when /^:/ # site same document collection html link url.gsub!(/^:/,"#{@env.url.root}/") @@ -294,7 +294,7 @@ module SiSU_ODF dob.obj.gsub!(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/, %{#{@brace_url.xml_open}<text:a xlink:type="simple" xlink:href="\\1">\\1</text:a>#{@brace_url.xml_close}}) #http ftp matches with decoration dob.obj.gsub!(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+)/, - %{#{@brace_url.xml_open}<text:a xlink:type="simple" xlink:href="mailto:\\1">\\1</text:a>#{@brace_url.xml_close}}) if dob.obj !~/http:\/\// # improve upon, document crash where url contains '@' symbol + %{#{@brace_url.xml_open}<text:a xlink:type="simple" xlink:href="mailto:\\1">\\1</text:a>#{@brace_url.xml_close}}) if dob.obj !~/https?:\/\// # improve upon, document crash where url contains '@' symbol dob.obj= if dob.is=='para' and dob.indent.to_s =~/[0-9]/ # and t_o.bullet_==true %{<text:p text:style-name="P1#{dob.indent}">#{dob.obj}</text:p>} else %{<text:p text:style-name="P1">#{dob.obj}</text:p>} @@ -369,7 +369,7 @@ module SiSU_ODF dob.obj.gsub!(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/, %{#{@brace_url.xml_open}<text:a xlink:type="simple" xlink:href="\\1">\\1</text:a>#{@brace_url.xml_close}}) #http ftp matches with decoration dob.obj.gsub!(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+)/, - %{#{@brace_url.xml_open}<text:a xlink:type="simple" xlink:href="mailto:\\1">\\1</text:a>#{@brace_url.xml_close}}) if dob.obj !~/http:\/\// # improve upon, document crash where url contains '@' symbol + %{#{@brace_url.xml_open}<text:a xlink:type="simple" xlink:href="mailto:\\1">\\1</text:a>#{@brace_url.xml_close}}) if dob.obj !~/https?:\/\// # improve upon, document crash where url contains '@' symbol dob.obj.split(/#{Mx[:br_line]}|#{Mx[:br_nl]}/).each do |parablock| parablock=group_clean(parablock) parablock.gsub!(/<text:a xlink:type="simple" xlink:href="(.+?)">/m,'<text:a xlink:type="simple" xlink:href="\1">') diff --git a/lib/sisu/v2/param.rb b/lib/sisu/v2/param.rb index 285859d7..fbc4ccde 100644 --- a/lib/sisu/v2/param.rb +++ b/lib/sisu/v2/param.rb @@ -1098,7 +1098,7 @@ module SiSU_Param if @ec[:image].length > 0 @ec[:image].flatten! @ec[:image].uniq! - @ec[:image].delete_if {|x| x =~/http:\/\// } + @ec[:image].delete_if {|x| x =~/https?:\/\// } @ec[:image].sort! end @ec[:audio].uniq!; @ec[:audio].flatten!; @ec[:audio].sort! diff --git a/lib/sisu/v2/remote.rb b/lib/sisu/v2/remote.rb index 4efe1770..32bc336d 100644 --- a/lib/sisu/v2/remote.rb +++ b/lib/sisu/v2/remote.rb @@ -145,7 +145,7 @@ module SiSU_Remote and images.length > 1 images.flatten! images.uniq! - images.delete_if {|x| x =~/http:\/\// } + images.delete_if {|x| x =~/https?:\/\// } images.sort! @msg,@msgs='downloading images:', [ images.join(',') ] @tell.call.warn unless @opt.cmd =~/q/ @@ -181,7 +181,7 @@ module SiSU_Remote @requested_file=requested_file end def pod - re_p_div=/http:\/\/([^\/]+)(\/\S+)\/(sisupod(?:\.zip)?|\S+?(?:\.ss[mt]\.zip)?|[^\/]+?\.ssp)$/ + re_p_div=/https?:\/\/([^\/]+)(\/\S+)\/(sisupod(?:\.zip)?|\S+?(?:\.ss[mt]\.zip)?|[^\/]+?\.ssp)$/ re_p=/(sisupod(?:\.zip)?|\S+?\.ss[mt](?:\.zip)?|[^\/]+?\.ssp)$/ if @requested_file =~ re_p_div @site,@pth,@pod= re_p_div.match(@requested_file).captures diff --git a/lib/sisu/v2/shared_html_lite.rb b/lib/sisu/v2/shared_html_lite.rb index c1f53e10..2743a450 100644 --- a/lib/sisu/v2/shared_html_lite.rb +++ b/lib/sisu/v2/shared_html_lite.rb @@ -112,7 +112,7 @@ module SiSU_Format_Shared word.gsub!(/#{Mx[:lnk_o]}.+?#{Mx[:lnk_c]}(#{Mx[:url_o]}\S+?#{Mx[:url_c]}|image)/,ins) else u=case u - when /^http:\/\// + when /^https?:\/\// u when /^:/ u.gsub!(/^:/,'') diff --git a/lib/sisu/v2/sisupod_make.rb b/lib/sisu/v2/sisupod_make.rb index c721f257..188e3315 100644 --- a/lib/sisu/v2/sisupod_make.rb +++ b/lib/sisu/v2/sisupod_make.rb @@ -219,7 +219,7 @@ module SiSU_Doc and images.length > 1 images.flatten! images.uniq! - images.delete_if {|x| x =~/http:\/\// } + images.delete_if {|x| x =~/https?:\/\// } #images.sort! image_path_pwd='_sisu/image' path_pod_conf="#{@env.path.processing}/sisupod/_sisu" diff --git a/lib/sisu/v2/texpdf.rb b/lib/sisu/v2/texpdf.rb index 84347cba..8b92270f 100644 --- a/lib/sisu/v2/texpdf.rb +++ b/lib/sisu/v2/texpdf.rb @@ -533,7 +533,7 @@ module SiSU_TeX tst=SiSU_TeX_Pdf::Format_text_object.new(@md,dob) dob=tst.urls_txt_and_images dob - elsif dob.tmp =~/http:\/\/\S+\b/m \ + elsif dob.tmp =~/https?:\/\/\S+\b/m \ and dob.is =='code' dob=SiSU_TeX_Pdf::Bare_urls.new(@md,dob).bare_urls_in_code dob diff --git a/lib/sisu/v2/texpdf_format.rb b/lib/sisu/v2/texpdf_format.rb index 68190407..32ac7aa5 100644 --- a/lib/sisu/v2/texpdf_format.rb +++ b/lib/sisu/v2/texpdf_format.rb @@ -72,7 +72,7 @@ module SiSU_TeX_Pdf end def bare_urls_in_code @dob.tmp.gsub!(/(^|[^\\])_/m,'\1\_') #watch may not work - @dob.tmp.gsub!(/(http:\/\/\S+?)([{]|[.,;)\]]?(?: |$))/m, + @dob.tmp.gsub!(/(https?:\/\/\S+?)([{]|[.,;)\]]?(?: |$))/m, '\begin{scriptsize}\url{\1}\end{scriptsize}\2') @dob end @@ -1060,18 +1060,18 @@ WOK str.gsub!(/<=lt>/m,'{\UseTextSymbol{OML}{<}}') str.gsub!(/<=gt>/m,'{\UseTextSymbol{OML}{>}}') str.gsub!(/<=underscore>/,'\_') - while str =~/(http:\/\/\S+?)(?:<=tilde>\S+)+/ #tilde in urls \href treated differently from text #FIX - str.gsub!(/(http:\/\/\S+?)(?:<=tilde>(\S+))+/,'\1~\2') + while str =~/(https?:\/\/\S+?)(?:<=tilde>\S+)+/ #tilde in urls \href treated differently from text #FIX + str.gsub!(/(https?:\/\/\S+?)(?:<=tilde>(\S+))+/,'\1~\2') end str.gsub!(/<=tilde>/,'{$\tilde$}') str.gsub!(/<=pipe>/,'{\textbar}') str.gsub!(/<=caret>/,'{\^{~}}') str.gsub!(/<=exclaim>/,'\Verbatim{!}') - str.gsub!(/(http:\/\/\S+?)(?:(?:<=hash>)(\S+))+/,'\1#\2') #hash in urls \href treated differently from text #FIX + str.gsub!(/(https?:\/\/\S+?)(?:(?:<=hash>)(\S+))+/,'\1#\2') #hash in urls \href treated differently from text #FIX str.gsub!(/<=hash>/,'{\#}') str.gsub!(/<=hardspace>/,'{~}') #changed ... 2005 - while str =~/(http:\/\/\S+?)(?:<=amp>\S+)+/ #amp in urls \href treated differently from text #FIX - str.gsub!(/(http:\/\/\S+?)(?:<=amp>(\S+))+/,'\1&\2') + while str =~/(https?:\/\/\S+?)(?:<=amp>\S+)+/ #amp in urls \href treated differently from text #FIX + str.gsub!(/(https?:\/\/\S+?)(?:<=amp>(\S+))+/,'\1&\2') end str.gsub!(/<=amp>/,'{\\\&}') #changed ... 2005 str.gsub!(/<=slash>/,'{/}') diff --git a/lib/sisu/v2/xml_format.rb b/lib/sisu/v2/xml_format.rb index ccef9b19..1558315c 100644 --- a/lib/sisu/v2/xml_format.rb +++ b/lib/sisu/v2/xml_format.rb @@ -665,7 +665,7 @@ WOK end end def links_guide_vertical_open #??? - url=(((defined? @vz.url_hp) && @vz.url_hp =~/^http:\/\/\S+$/) ? @vz.url_hp : @vz.url_home) + url=(((defined? @vz.url_hp) && @vz.url_hp =~/^https?:\/\/\S+$/) ? @vz.url_hp : @vz.url_home) %{ <div id="vertical_links"> <ul id="vertical"> @@ -685,7 +685,7 @@ WOK <!- quick ref -!>} end def links_guide_horizontal_open #??? - url=(((defined? @vz.url_hp) && @vz.url_hp =~/^http:\/\/\S+$/) ? @vz.url_hp : @vz.url_home) + url=(((defined? @vz.url_hp) && @vz.url_hp =~/^https?:\/\/\S+$/) ? @vz.url_hp : @vz.url_home) %{ <div id="horizontal_links"> <ul id="horizontal"> |