diff options
author | Ralph Amissah <ralph@amissah.com> | 2010-05-26 17:39:12 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2010-05-26 17:39:12 -0400 |
commit | 4aff107c62488189004fdca535d4720d2e97b931 (patch) | |
tree | bb08c3987f85def8b6d50951a39a387f9cdd1522 | |
parent | sha256 (2.4.0) (diff) |
epub & odf, regex matches for http: to include https:
-rw-r--r-- | lib/sisu/v2/epub_tune.rb | 2 | ||||
-rw-r--r-- | lib/sisu/v2/odf.rb | 6 |
2 files changed, 4 insertions, 4 deletions
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/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">') |