aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v2
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v2')
-rw-r--r--lib/sisu/v2/dal_doc_str.rb2
-rw-r--r--lib/sisu/v2/dal_substitutions_and_insertions.rb6
-rw-r--r--lib/sisu/v2/dal_syntax.rb8
-rw-r--r--lib/sisu/v2/epub_tune.rb7
-rw-r--r--lib/sisu/v2/help.rb25
-rw-r--r--lib/sisu/v2/html_tune.rb7
-rw-r--r--lib/sisu/v2/manpage.rb26
-rw-r--r--lib/sisu/v2/odf.rb10
-rw-r--r--lib/sisu/v2/param.rb12
-rw-r--r--lib/sisu/v2/shared_xml.rb2
-rw-r--r--lib/sisu/v2/texpdf_format.rb6
11 files changed, 41 insertions, 70 deletions
diff --git a/lib/sisu/v2/dal_doc_str.rb b/lib/sisu/v2/dal_doc_str.rb
index bca3cf7d..56bf205f 100644
--- a/lib/sisu/v2/dal_doc_str.rb
+++ b/lib/sisu/v2/dal_doc_str.rb
@@ -330,7 +330,7 @@ module SiSU_document_structure_extract
sub_array=t_o.dup + "#{Mx[:br_nl]}"
@line_mode=sub_array.scan(/.+/)
@line_mode=[]
- sub_array.scan(/.+/) {|w| @line_mode << w if w =~/[\Ss]+/}
+ sub_array.scan(/.+/) {|w| @line_mode << w if w =~/[\S]+/}
t_o=SiSU_document_structure_extract::Build.new(@md,@line_mode).build_lines('code').join
@tuned_code << t_o
t_o=nil
diff --git a/lib/sisu/v2/dal_substitutions_and_insertions.rb b/lib/sisu/v2/dal_substitutions_and_insertions.rb
index e1326232..c598b990 100644
--- a/lib/sisu/v2/dal_substitutions_and_insertions.rb
+++ b/lib/sisu/v2/dal_substitutions_and_insertions.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
@@ -144,8 +144,8 @@ module SiSU_substitute_and_insert
para.gsub!(/^(:?A~)\s*$/,'\1~ @title @author') #conditional header
para.gsub!(/^((?:[1-9]|:?[A-C])~\S*)\s*$/,'\1~ [Note: heading marker::required title missing]~#') #conditional header for incorporated document 2004w12
if para =~/^@\S+?:/
- para.gsub!(/^@(\S+?):\s+/,"#{Mx[:meta_o]}\\1#{Mx[:meta_c]}")
- para.gsub!(/^@(\S+?):([+-])\s+/,"#{Mx[:meta_o]}\\1\\2#{Mx[:meta_c]}")
+ para.gsub!(/^@(\S+?):(\s+|$)/,"#{Mx[:meta_o]}\\1#{Mx[:meta_c]}\\2")
+ para.gsub!(/^@(\S+?):([+-])(\s+|$)/,"#{Mx[:meta_o]}\\1\\2#{Mx[:meta_c]}\\3")
end
end
end
diff --git a/lib/sisu/v2/dal_syntax.rb b/lib/sisu/v2/dal_syntax.rb
index 47c7f8d0..76287464 100644
--- a/lib/sisu/v2/dal_syntax.rb
+++ b/lib/sisu/v2/dal_syntax.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
@@ -327,7 +327,7 @@ module SiSU_Syntax
else dob.obj.gsub!(/^\s*(?:(by\s+)?(?:@creator|@author))\s*$/,'\1')
end
end
- dob.obj.gsub!(/<(https?:\/\/\S+?)>/,'< \1 >') #catch problem markup
+ dob.obj.gsub!(/<(https?:\/\/\S+?)>/,'< \1 >') #catch problem markup
dob.obj.gsub!(/<:=(\S+?)>/,'{ c_\1.png 14x14 }http://www.jus.uio.no/sisu') #adjustment 2005w30
dob.obj.gsub!(/<!(\S+)!>/,'<:\1>') #escaped special character
dob.obj.gsub!(/&nbsp;/,"#{Mx[:nbsp]}") #escaped special character
@@ -398,9 +398,10 @@ module SiSU_Syntax
"#{Mx[:lnk_o]}\\1#{Mx[:lnk_c]}#{Mx[:url_o]}\\2#{Mx[:url_c]}\\3") #any remaining linked text or image
dob.obj.gsub!(/\{\s*(.+?)\s*\}(#{Mx[:url_o]}\S+?#{Mx[:url_c]})/,
"#{Mx[:lnk_o]}\\1#{Mx[:lnk_c]}\\2") #any remaining linked text or image
+ dob.obj.gsub!(/(^|\s)([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)/,"\\1#{Mx[:url_o]}\\2#{Mx[:url_c]}")
dob.obj.gsub!(/(^|[ ])\{\s*(.+?)\s*\}(\S+?)([;,.]?)(?=\s|[#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}#{Mx[:en_a_o]}#{Mx[:en_b_o]}]|$)/,
"\\1#{Mx[:lnk_o]}\\2#{Mx[:lnk_c]}\\3\\4") #any remaining linked text or image
- dob.obj.gsub!(/\{\s*(.+?)\s*\}#(\S+?)([;,.]?)(?=\s|[#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}#{Mx[:en_a_o]}#{Mx[:en_b_o]}]|$)/,
+ dob.obj.gsub!(/\{\s*(.+?)\s*\}#([a-zA-Z0-9][a-zA-Z0-9_-]*)([;,.]?)(?=\s|[#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}#{Mx[:en_a_o]}#{Mx[:en_b_o]}]|$)/,
"#{Mx[:lnk_o]}\\1#{Mx[:lnk_c]}#{Mx[:rel_o]}\\2#{Mx[:rel_c]}\\3") #any remaining linked text or image, check need
dob.obj.gsub!(/\{\s*(.+?)\s*\}(#{Mx[:rel_o]}\S+?#{Mx[:rel_c]})/,
"#{Mx[:lnk_o]}\\1#{Mx[:lnk_c]}\\2") #any remaining linked text or image, check need
@@ -409,7 +410,6 @@ module SiSU_Syntax
elsif dob.is=='table'
dob=fontface(dob)
elsif dob.is =='code'
-#p dob.obj
dob.obj.gsub!(/#{Mx[:meta_o]}(\S+?)#{Mx[:meta_c]}\s*/,'@\1: ')
dob.obj.gsub!(/([<>])/,'_\1')
dob.obj.gsub!(/_<:(\S+?)_>/,'<:\1>') #convert <:\S+> back, clumsy
diff --git a/lib/sisu/v2/epub_tune.rb b/lib/sisu/v2/epub_tune.rb
index 10583936..9c9223a0 100644
--- a/lib/sisu/v2/epub_tune.rb
+++ b/lib/sisu/v2/epub_tune.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
@@ -349,11 +349,8 @@ module SiSU_EPUB_Tune
dob.obj.gsub!(/!new/,%{&nbsp;<img border="0" height="15" width="15" src="#{@env.url.images_epub}/#{@vz.icon_new}" alt="new" />})
dob.obj.gsub!(/<:h(.{1,7}?)>/,'<a href="#h\1">\1</a>')
dob.obj.gsub!(/<:to(\d{1,7}?)>/,'<a href="#to\1">to&nbsp;{&nbsp;\1&nbsp;}</a> ')
- if dob.obj =~/\b\S+\@\S+?\.\S+/ \
- and dob.obj !~/(\"\S+\@\S+?\.\S+\"|>\S+\@\S+?\.\S+?<)/
- dob.obj.gsub!(/([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)/,'&lt;<a href="mailto:\1">\1</a>&gt;')
- end
dob.obj.gsub!(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/,'<a href="\1" target="_top">\1</a>') #http ftp matches escaped, no decoration
+ dob.obj.gsub!(/#{Mx[:url_o]}([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)#{Mx[:url_c]}/,%{#{@brace_url.xml_open}<a href="mailto:\\1">\\1</a>#{@brace_url.xml_close}})
dob.obj.gsub!(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,%{#{@brace_url.xml_open}<a href="\\1" target="_top">\\1</a>#{@brace_url.xml_close}}) #http ftp matches with decoration
if dob.obj =~/..\/\S+/ \
and dob.obj !~/(\"..\/\S+?\"|>\s*..\/\S+<)/
diff --git a/lib/sisu/v2/help.rb b/lib/sisu/v2/help.rb
index b07ab6ed..85bb898c 100644
--- a/lib/sisu/v2/help.rb
+++ b/lib/sisu/v2/help.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
@@ -1426,7 +1426,7 @@ WOK
sisu --help example
sample marked up documents are provided in directory:
- #{@cX.green}sisu-examples/sample/document_samples_sisu_markup/#{@cX.off}
+ #{@cX.green}/usr/share/doc/sisu/markup-samples#{@cX.off}
and online
#{@cX.green}www.jus.uio.no/sisu#{@cX.off}
WOK
@@ -1672,22 +1672,7 @@ WOK
def hyperestraier
out_dir='(' + `ls #{@env.path.webserv}`.split("\n").join('|') + ')'
print <<WOK
- See the documentation for hyperestraier
- #{@cX.blue}
- http://hyperestraier.sourceforge.net/
-
- file:///usr/share/doc/hyperestraier/index.html
- #{@cX.off} #{@cX.orange}
- man estcmd
- #{@cX.off}
-
- on sisu_hyperestraier:
-
- #{@cX.blue}
- man sisu_hyperestraier
-
- /usr/share/doc/sisu/sisu_markup/sisu_hyperestraier/index.html
- #{@cX.off}
+ Not tested recently, not up-to-date
NOTE: The examples that follow assume that sisu output is placed in the directory
/home/ralph/sisu_www
@@ -1784,7 +1769,7 @@ WOK
SiSU, a framework for document structuring, publishing and search
- Copyright (C) 1997 - 2010 Ralph Amissah
+ Copyright (C) 1997 - 2011 Ralph Amissah
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
@@ -1831,7 +1816,7 @@ WOK
* Standard SiSU meta-markup syntax, and the
* Standard SiSU object citation numbering and system
-© Ralph Amissah 1997, current 2010.
+© Ralph Amissah 1997, current 2011.
All Rights Reserved.
Information on these may be obtained from:
diff --git a/lib/sisu/v2/html_tune.rb b/lib/sisu/v2/html_tune.rb
index 9d3dce0b..99ce1b0f 100644
--- a/lib/sisu/v2/html_tune.rb
+++ b/lib/sisu/v2/html_tune.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
@@ -321,11 +321,8 @@ module SiSU_HTML_Tune
dob.obj.gsub!(/!new/,%{&nbsp;<img border="0" height="15" width="15" src="#{@env.url.images}/#{@vz.icon_new}" alt="new">})
dob.obj.gsub!(/<:h(.{1,7}?)>/,'<a href="#h\1">\1</a>')
dob.obj.gsub!(/<:to(\d{1,7}?)>/,'<a href="#to\1">to&nbsp;{&nbsp;\1&nbsp;}</a> ')
- if dob.obj =~/\b\S+\@\S+?\.\S+/ \
- and dob.obj !~/(\"\S+\@\S+?\.\S+\"|>\S+\@\S+?\.\S+?<)/
- dob.obj.gsub!(/([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)/,'&lt;<a href="mailto:\1">\1</a>&gt;')
- end
dob.obj.gsub!(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/,'<a href="\1" target="_top">\1</a>') #http ftp matches escaped, no decoration
+ dob.obj.gsub!(/#{Mx[:url_o]}([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)#{Mx[:url_c]}/,%{#{@brace_url.xml_open}<a href="mailto:\\1">\\1</a>#{@brace_url.xml_close}})
dob.obj.gsub!(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,%{#{@brace_url.xml_open}<a href="\\1" target="_top">\\1</a>#{@brace_url.xml_close}}) #http ftp matches with decoration
if dob.obj =~/..\/\S+/ \
and dob.obj !~/(\"..\/\S+?\"|>\s*..\/\S+<)/
diff --git a/lib/sisu/v2/manpage.rb b/lib/sisu/v2/manpage.rb
index 18670e2a..a040f1a0 100644
--- a/lib/sisu/v2/manpage.rb
+++ b/lib/sisu/v2/manpage.rb
@@ -152,7 +152,7 @@ GSUB
)
end
@@endnotes[:para] << wrap
- @@endnotes[:end] << wrap << "\n.BR"
+ @@endnotes[:end] << wrap << "\n.br"
@@endnotes
end
end
@@ -176,16 +176,6 @@ Other versions of this document:
.TP
manifest: <#{vz.url_root_http}/#{@md.fnb}/#{@md.fn[:manifest]}>
.TP
-html: <#{vz.url_root_http}/#{@md.fnb}/#{@md.fn[:toc]}>
-.TP
-epub: <#{vz.url_root_http}/epub/#{@md.fnb}.epub>
-.TP
-pdf: <#{vz.url_root_http}/#{@md.fnb}/#{@md.fn[:pdf_p]}>
-.TP
-pdf: <#{vz.url_root_http}/#{@md.fnb}/#{@md.fn[:pdf_l]}>
-.\" .TP
-.\" manpage: #{vz.url_root_http}/#{@md.fnb}/#{@md.fn[:manpage]}
-.TP
at: <#{vz.url_site}>
.TP
#{sc}
@@ -231,16 +221,16 @@ WOK
times=wrapped.length
times=78 if times > 78
@manpage[:body] << case lv
- when 1; '.SH ' << @br << wrapped.upcase << @br << '.BR'
- when 2..3; '.SH ' << @br << wrapped.upcase << @br << '.BR'
- when 4; '.SH ' << @br << wrapped.upcase << @br << '.BR'
- when 5..6; '.SH ' << @br << wrapped.upcase << @br
+ when 1; '.SH ' << wrapped.upcase << @br << '.br'
+ when 2..3; '.SH ' << wrapped.upcase << @br << '.br'
+ when 4; '.SH ' << wrapped.upcase << @br << '.br'
+ when 5..6; '.SH ' << wrapped.upcase << @br
end
else
@manpage[:body] << if wrapped =~/^\.BI\s/ # main text, contents, body KEEP
'.TP' << @br << wrapped.gsub!(/^\.BI\s/,'.B ') # sleight ... simpler output
else
- '.BR' << @br << wrapped
+ '.br' << @br << wrapped
end
end
if @@endnotes[:para] \
@@ -308,12 +298,12 @@ WOK
if dob.is =='code'
dob.obj.gsub!(/(^|[^}])_([<>])/m,'\1\2') # _> _<
dob.obj.gsub!(/(^|[^}])_([<>])/m,'\1\2') # _<_<
- dob.obj.gsub!(/\A(.+)?\Z/m,"\n\n.nf\n\n\\1\n\n.fi\n\n") #dob.obj.gsub!(/\A/,"\n\n.nf\n\n"); #dob.obj.gsub!(/\Z/,"\n\n.fi\n\n") #bug, .fi repeats
+ dob.obj.gsub!(/\A(.+)?\Z/m,".nf\n\n\\1\n\n.fi")
end
else
dob.obj.gsub!(/(?:#{Mx[:br_line]}|#{Mx[:br_nl]})\s*/,"\n\n") #unless para =~/#{Mx[:lv_o]}\d:/ #watch introduces a bug
end
- dob.obj.gsub!(/(?:#{Mx[:br_line]}|#{Mx[:br_nl]})+\s*/,"\n\n.BR\n\n") # watch
+ dob.obj.gsub!(/(?:#{Mx[:br_line]}|#{Mx[:br_nl]})+\s*/,"\n\n.br\n\n") # watch
blit=dob.obj.scan(/\[[^\]]+\]|[^\[]+/)
blit_array=[]
blit.each do |x|
diff --git a/lib/sisu/v2/odf.rb b/lib/sisu/v2/odf.rb
index 2e2a88b4..b6ec4c1b 100644
--- a/lib/sisu/v2/odf.rb
+++ b/lib/sisu/v2/odf.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
@@ -291,10 +291,10 @@ module SiSU_ODF
def normal(dob) #P1 - P3
dob.obj.gsub!(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/,
'<text:a xlink:type="simple" xlink:href="\1">\1</text:a>') #http ftp matches escaped, no decoration
+ dob.obj.gsub!(/#{Mx[:url_o]}([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)#{Mx[:url_c]}/,
+ %{#{@brace_url.xml_open}<text:a xlink:type="simple" xlink:href="mailto:\\1">\\1</text:a>#{@brace_url.xml_close}})
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 !~/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>}
@@ -372,10 +372,10 @@ module SiSU_ODF
parray=[]
dob.obj.gsub!(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/,
'<text:a xlink:type="simple" xlink:href="\1">\1</text:a>') #http ftp matches escaped, no decoration
+ dob.obj.gsub!(/#{Mx[:url_o]}([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)#{Mx[:url_c]}/,
+ %{#{@brace_url.xml_open}<text:a xlink:type="simple" xlink:href="mailto:\\1">\\1</text:a>#{@brace_url.xml_close}})
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 !~/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!(/&lt;text:a xlink:type="simple" xlink:href="(.+?)"&gt;/m,'<text:a xlink:type="simple" xlink:href="\1">')
diff --git a/lib/sisu/v2/param.rb b/lib/sisu/v2/param.rb
index 207154b0..655177a7 100644
--- a/lib/sisu/v2/param.rb
+++ b/lib/sisu/v2/param.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
@@ -732,16 +732,14 @@ module SiSU_Param
end
end
if manpage['name']
- manpage['name']=manpage['name'].join("\n.BR\n")
- manpage['name'].gsub!(/(-)/m,"\\\\\\1")
- manpage['name'].gsub!(/\A/,"\n.SH NAME\n")
+ manpage['name']=manpage['name'].join("\n.br\n")
+ manpage['name'].gsub!(/\A/,"\n.br\n.SH NAME\n.br\n")
else
manpage['name']='man page "name/whatis" information not provided, set in header @man: name=[whatis information]'
end
if manpage['synopsis']
- manpage['synopsis']=manpage['synopsis'].join("\n\n.BR\n")
- manpage['synopsis'].gsub!(/(-)/m,"\\\\\\1")
- manpage['synopsis'].gsub!(/\A/,"\n.SH SYNOPSIS\n")
+ manpage['synopsis']=manpage['synopsis'].join("\n\n.br\n")
+ manpage['synopsis'].gsub!(/\A/,"\n.br\n.SH SYNOPSIS\n.br\n")
else
manpage['synopsis']=''
end
diff --git a/lib/sisu/v2/shared_xml.rb b/lib/sisu/v2/shared_xml.rb
index 2fcab17e..e82f51bf 100644
--- a/lib/sisu/v2/shared_xml.rb
+++ b/lib/sisu/v2/shared_xml.rb
@@ -398,6 +398,8 @@ module SiSU_XML_munge
if dob.of=='group'
dob.obj.gsub!(/#{Mx[:gl_bullet]}/,'● ')
end
+ dob.obj.gsub!(/#{Mx[:url_o]}([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)#{Mx[:url_c]}/,
+ %{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}})
dob.obj.gsub!(/#{Dx[:url_o]}/,"#{Dx[:url_o_xml]}")
dob.obj.gsub!(/#{Dx[:url_c]}/,"#{Dx[:url_c_xml]}")
dob.obj.gsub!(/&nbsp;|#{Mx[:nbsp]}/m,'&#160;')
diff --git a/lib/sisu/v2/texpdf_format.rb b/lib/sisu/v2/texpdf_format.rb
index 732a903e..dbf0d095 100644
--- a/lib/sisu/v2/texpdf_format.rb
+++ b/lib/sisu/v2/texpdf_format.rb
@@ -7,7 +7,7 @@
* Author: Ralph Amissah
- * Copyright: (C) 1997 - 2010, Ralph Amissah, All Rights Reserved.
+ * Copyright: (C) 1997 - 2011, Ralph Amissah, All Rights Reserved.
* License: GPL 3 or later:
@@ -65,6 +65,8 @@ module SiSU_TeX_Pdf
@brace_url=SiSU_Viz::Skin.new.url_decoration
end
def bare_urls
+ @dob.obj.gsub!(/#{Mx[:url_o]}([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)#{Mx[:url_c]}/,
+ "#{@brace_url.tex_open}\\1</a>#{@brace_url.tex_close}")
@dob.tmp.gsub!(/(^|[^\\])_/m,'\1\_') #watch may not work
@dob.tmp.gsub!(/(^|[^#{Mx[:lnk_c]}])#{Mx[:url_o]}_?(?:\\?_)?(\S+?)#{Mx[:url_c]}/m,
"\\1#{@brace_url.tex_open}\\begin{scriptsize}\\url{\\2}\\end{scriptsize}#{@brace_url.tex_close}")
@@ -970,7 +972,7 @@ WOK
para_array=[]
str=if word
word.each do |w| # _ - / # | : ! ^ ~
- if w !~/http:/ \
+ if w !~/https?:/ \
and w=~/\/\S+?\// \
and w.length > 6
w.gsub!(/([_.\/])/,'\1\-')