diff options
author | Ralph Amissah <ralph@amissah.com> | 2014-10-12 10:46:48 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2014-10-12 10:46:48 -0400 |
commit | 53b74bac29e476d4000b76d10acc0c31e2376669 (patch) | |
tree | 0624c1e81d661c6f1296e66679b9e9cd29debaac /lib/sisu/v6/shared_metadata.rb | |
parent | v5 v6: html, epub, set document body language (diff) |
v6: '*_parts', remove defaults.rb & some relics related to sisu skins, long gone
* old code removed & substituted as required by *_parts
* attending code changes, fairly wide ranging, test
Diffstat (limited to 'lib/sisu/v6/shared_metadata.rb')
-rw-r--r-- | lib/sisu/v6/shared_metadata.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/sisu/v6/shared_metadata.rb b/lib/sisu/v6/shared_metadata.rb index 998c48df..646d7f72 100644 --- a/lib/sisu/v6/shared_metadata.rb +++ b/lib/sisu/v6/shared_metadata.rb @@ -58,8 +58,10 @@ =end module SiSU_Metadata + require_relative 'xml_parts' # xml_parts.rb require_relative 'xml_shared' # xml_shared.rb class Summary + include SiSU_Parts_XML attr_accessor :tag,:inf,:class,:attrib def initialize(md,display_heading=false) @md,@display_heading=md,display_heading @@ -916,7 +918,6 @@ WOK end def odf def meta_para - url_brace=SiSU_Viz::Defaults.new.url_decoration if @inf.is_a?(String) @inf=@inf.gsub(/</,'<').gsub(/>/,'>'). gsub(/<br(?: \/)?>/,'<br />') @@ -938,13 +939,13 @@ WOK '\1<text:a xl:type="simple" xl:href="\2">\2</text:a>') #special case \{ e.g. \}http://url @inf=if @inf =~/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/ @inf.gsub(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/, - %{#{url_brace.xml_open}<text:a xl:type="simple" xl:href="\\1">\\1</text:a>#{url_brace.xml_close}}) #http ftp matches with decoration + %{#{the_url_decoration.xml_open}<text:a xl:type="simple" xl:href="\\1">\\1</text:a>#{the_url_decoration.xml_close}}) #http ftp matches with decoration else @inf.gsub(/(https?:\/\/[^<>()'"\s]+)/, - %{#{url_brace.xml_open}<text:a xl:type="simple" xl:href="\\1">\\1</text:a>#{url_brace.xml_close}}) #http ftp matches with decoration + %{#{the_url_decoration.xml_open}<text:a xl:type="simple" xl:href="\\1">\\1</text:a>#{the_url_decoration.xml_close}}) #http ftp matches with decoration end @inf=@inf.gsub(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+)/, - %{#{url_brace.xml_open}<text:a xl:type="simple" xl:href="mailto:\\1">\\1</text:a>#{url_brace.xml_close}}) if @inf !~/http:\/\// # improve upon, document crash where url contains '@' symbol + %{#{the_url_decoration.xml_open}<text:a xl:type="simple" xl:href="mailto:\\1">\\1</text:a>#{the_url_decoration.xml_close}}) if @inf !~/http:\/\// # improve upon, document crash where url contains '@' symbol end <<WOK <text:p text:style-name="P1">#{@tag.capitalize}: #{@inf}</text:p> |