aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2008-08-29 21:40:02 -0400
committerRalph Amissah <ralph@amissah.com>2008-08-29 21:40:02 -0400
commit749e0d8443028eaff7af93d17c8dae8d44be42bc (patch)
tree256bda91525894d928c74f8984d5e429311e0cb6
parenttexpdf: removed space at beginning of paragraph; grouped text url fix (diff)
texpdf: paper use dimensions, tolerance, url matching; removal of dummy headings when not used; manifest presentation
* texpdf: paper use dimensions, tolerance, url matching; * removal of dummy headings when not used (html scroll, latex/pdf, odf) * manifest presentation
-rw-r--r--CHANGELOG10
-rw-r--r--lib/sisu/v0/defaults.rb12
-rw-r--r--lib/sisu/v0/html_scroll.rb1
-rw-r--r--lib/sisu/v0/i18n.rb54
-rw-r--r--lib/sisu/v0/manifest.rb29
-rw-r--r--lib/sisu/v0/odf.rb1
-rw-r--r--lib/sisu/v0/plaintext.rb4
-rw-r--r--lib/sisu/v0/texpdf.rb15
-rw-r--r--lib/sisu/v0/texpdf_format.rb20
-rw-r--r--lib/sisu/v0/xml.rb3
10 files changed, 102 insertions, 47 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 41a3f097..e4f5dd41 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -21,20 +21,24 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.69.0.orig.tar.gz
sisu -CC
* html css, use of mini table of contents placed in left column for
segmented text
+ * manifest presentation
* texpdf
* pdf document typesetting dimensions
- * url and urlbreaks line breaking fix
- * better representation of tilde
- * removal of a maths package gives back typeface changes like bold
+ * url matching and urlbreaks line breaks fix
* landscape output, tables fixed
* paragraph alignment, assigned 0 width to required space, (removing space
at beginning of paragraph)
* footnote, number placement changed, and left alignment (ragged edges)
used
+ * removal of a maths package gives back typeface changes like bold
+ * better representation of tilde
+ * tolerance
* middle layer, url representation changed, downstream code affected
+ * dummy headings removed when not used, latex/pdf, odf, html scroll
+
* internal, greater use of passing of hash to formatting modules
%% sisu_0.68.0.orig.tar.gz (2008-07-22:29/2)
diff --git a/lib/sisu/v0/defaults.rb b/lib/sisu/v0/defaults.rb
index 801b6434..a3e1b16d 100644
--- a/lib/sisu/v0/defaults.rb
+++ b/lib/sisu/v0/defaults.rb
@@ -2095,7 +2095,7 @@ WOK
end
def landscape
def w
- 250
+ 238
end
def h
160
@@ -2122,7 +2122,7 @@ WOK
end
def landscape
def w
- 234
+ 226
end
def h
166
@@ -2140,7 +2140,7 @@ WOK
168
end
def h
- 294
+ 286
end
def img_px
474
@@ -2149,7 +2149,7 @@ WOK
end
def landscape
def w
- 306
+ 296
end
def h
166
@@ -2176,7 +2176,7 @@ WOK
end
def landscape
def w
- 208
+ 200
end
def h
130
@@ -2203,7 +2203,7 @@ WOK
end
def landscape
def w
- 164
+ 152
end
def h
100
diff --git a/lib/sisu/v0/html_scroll.rb b/lib/sisu/v0/html_scroll.rb
index 9286df10..3e72f855 100644
--- a/lib/sisu/v0/html_scroll.rb
+++ b/lib/sisu/v0/html_scroll.rb
@@ -87,6 +87,7 @@ module SiSU_HTML_scroll
#if para =~/^#{Mx[:lv_o]}\d:endnotes#{Mx[:lv_c]}\s*Endnotes/
## para.gsub!(/Endnotes.+/,'')
#end
+ para='' if para =~/#{Mx[:lv_o]}\d+:.*?#{Mx[:lv_c]}.+?#{Mx[:pa_non_object_dummy_heading]}/
if para =~/^#{Mx[:lv_o]}\d:meta#{Mx[:lv_c]}\s*Document Information/
para.gsub!(/(Document Information(?: \(metadata\))?)/,'\1<a name="docinfo"></a>')
end
diff --git a/lib/sisu/v0/i18n.rb b/lib/sisu/v0/i18n.rb
index 8ac3ffc8..286ba65d 100644
--- a/lib/sisu/v0/i18n.rb
+++ b/lib/sisu/v0/i18n.rb
@@ -105,6 +105,9 @@ module SiSU_Translate
def metadata
@lang_class.metadata
end
+ def filetype_description
+ @lang_class.filetype_description
+ end
def file_size
@lang_class.file_size
end
@@ -258,6 +261,9 @@ module SiSU_Translate
def language
@lang_class.language
end
+ def manifest_description
+ @lang_class.manifest_description
+ end
def manifest_description_output
@lang_class.manifest_description_output
end
@@ -314,6 +320,9 @@ module SiSU_Translate
def description
'description'
end
+ def filetype_description
+ 'filetype description'
+ end
def metadata
'metadata'
end
@@ -464,11 +473,14 @@ module SiSU_Translate
def language_version_list
'Document Language Versions, manifests'
end
+ def manifest_description
+ 'SiSU manifest of document filetypes and metadata'
+ end
def manifest_description_output
- 'SiSU manifest'
+ 'Available document filetypes'
end
def manifest_description_metadata
- 'SiSU manifest of document metadata'
+ 'Document Metadata'
end
def language_list_translated
lang=case @trans_str
@@ -513,6 +525,9 @@ module SiSU_Translate
def description
'description'
end
+ def filetype_description
+ description
+ end
def metadata
'metadonnées'
end
@@ -663,6 +678,9 @@ module SiSU_Translate
def language_version_list
'Versions des langues du document, manifestes'
end
+ def manifest_description
+ 'SiSU manifest of document filetypes and metadata'
+ end
def manifest_description_output
'Manifeste SiSU du document généré'
end
@@ -712,6 +730,9 @@ module SiSU_Translate
def description
'Beschreibung'
end
+ def filetype_description
+ description
+ end
def metadata
'Metadata'
end
@@ -862,6 +883,9 @@ module SiSU_Translate
def language_version_list
'verfügbare Sprachen'
end
+ def manifest_description
+ 'SiSU manifest of document filetypes and metadata'
+ end
def manifest_description_output
'SiSU Zusammenfassung des Dokumentes'
end
@@ -907,10 +931,13 @@ module SiSU_Translate
end
def filename
'nombre del fichero'
- end
- def description
- 'descripción'
- end
+ end
+ def description
+ 'descripción'
+ end
+ def filetype_description
+ description
+ end
def metadata
'metadatos'
end
@@ -1061,6 +1088,9 @@ module SiSU_Translate
def language_version_list
'Document Language Versions, manifests'
end
+ def manifest_description
+ 'SiSU manifest of document filetypes and metadata'
+ end
def manifest_description_output
'Manifiesto SiSU de salida generada'
end
@@ -1110,6 +1140,9 @@ module SiSU_Translate
def description
'descrizione'
end
+ def filetype_description
+ description
+ end
def metadata
'metadati'
end
@@ -1260,6 +1293,9 @@ module SiSU_Translate
def language_version_list
'Traduzioni disponibili'
end
+ def manifest_description
+ 'SiSU manifest of document filetypes and metadata'
+ end
def manifest_description_output
'Inventario SiSU dell\'output generato'
end
@@ -1309,6 +1345,9 @@ module SiSU_Translate
def description
'kuvaus'
end
+ def filetype_description
+ description
+ end
def metadata
'metadata'
end
@@ -1459,6 +1498,9 @@ module SiSU_Translate
def language_version_list
'Dokumentin kieliversiot, manifestit'
end
+ def manifest_description
+ 'SiSU manifest of document filetypes and metadata'
+ end
def manifest_description_output
'Tuotetun tuloksen SISU-manifesti'
end
diff --git a/lib/sisu/v0/manifest.rb b/lib/sisu/v0/manifest.rb
index ffd99695..78045e80 100644
--- a/lib/sisu/v0/manifest.rb
+++ b/lib/sisu/v0/manifest.rb
@@ -65,6 +65,7 @@ module SiSU_Manifest
require "#{SiSU_lib}/particulars"
include SiSU_Particulars
require "#{SiSU_lib}/html_minitoc"
+ #require "#{SiSU_lib}/html_format"
require "#{SiSU_lib}/html"
include SiSU_HTML_Format
require "#{SiSU_lib}/param"
@@ -119,7 +120,7 @@ module SiSU_Manifest
manifest << x
end
end
- def summarize(id,file,img='')
+ def summarize(id,file,img='● ')
size=(File.size("#{@base_path}/#{file}")/1024.00).to_s
kb=/([0-9]+\.[0-9]{0,1})/m.match(size)[1]
@manifest[:txt] << "#{file} #{id} #{kb}\n"
@@ -177,7 +178,7 @@ module SiSU_Manifest
elsif url =~/^\.\.\//; url.gsub(/^\.(\.)?/,@env.url.root)
else url
end
- @manifest[:html] << %{<tr><th class="left"><p class="norm"><a href="#{url}">#{lnk}</a></p><p class="tiny">&nbsp;&nbsp;#{@url_brace.xml_open}<a href="#{static}">#{static}</a>#{@url_brace.xml_close}</p></th></tr>\n}
+ @manifest[:html] << %{<tr><th class="right" width=5%><p class="norm">●</p></th><td class="left"><p class="norm"><a href="#{url}">#{lnk}</a></p><p class="tiny">&nbsp;&nbsp;#{@url_brace.xml_open}<a href="#{static}">#{static}</a>#{@url_brace.xml_close}</p></td></tr>\n}
end
def output_tests
if FileTest.file?("#@base_path/#{@md.fn[:toc]}")==true
@@ -568,16 +569,26 @@ SiSU manifest: #{@md.title}
#{minitoc.to_s}
</div>
<div class="content">
-<h1 class="small">#{@md.dc_title}</h1>
+<h1 class="small">#{@translate.manifest_description}</h1>
+<h2 class="small">#{@md.dc_title}</h2>
<p class="bold">#{@md.dc_creator}</p>
+<p class="small">
+&nbsp;&nbsp;<a href="#output">Document, Available Filetypes</a>
+</p>
+<p class="small">
+&nbsp;&nbsp;<a href="#metadata">Document Metadata</a>
+</p>
+<p class="tiny">
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#links">(metadata suggested links (if any)</a>
+</p>
<table summary="normal text css" width="100%" border="0" bgcolor="white" cellpadding="2" align="center">
WOK
published_versions
@manifest[:html] << '</table>'
@manifest[:html] <<<<WOK
<h2 class="small"><a name="output">#{@translate.manifest_description_output}</a></h2>
-<table summary="normal text css" width="100%" border="0" bgcolor="white" cellpadding="2" align="center">
-<tr> <th class="left"><p class="bold">#{@translate.description}</p></th><th class="left"><p class="bold">#{@translate.filename}</p></th><th class="right"><p class="right"><b>#{@translate.file_size}</b></p><p class="tiny_right">(kB)</p></th></tr>
+<table summary="available output/filetypes" width="100%" border="0" bgcolor="white" cellpadding="2" align="center">
+<tr> <th class="left"><p class="bold">#{@translate.filetype_description}</p></th><th class="left"><p class="bold">#{@translate.filename}</p></th><th class="right"><p class="right"><b>#{@translate.file_size}</b></p><p class="tiny_right">(kB)</p></th></tr>
WOK
output_tests
@@ -589,7 +600,7 @@ WOK
@manifest[:html] << '</table>'
@manifest[:html] <<<<WOK
<h2 class="small"><a name="metadata">#{@translate.manifest_description_metadata}</a></h2>
-<table summary="normal text css" width="100%" border="0" bgcolor="white" cellpadding="2" align="center">
+<table summary="document metadata" width="100%" border="0" bgcolor="white" cellpadding="2" align="center">
<tr> <th class="left"><p class="bold">#{@translate.metadata}</p></th><th class="left"><p class="bold">#{@translate.description}</p></th></tr>
WOK
metadata_tests
@@ -597,8 +608,8 @@ WOK
</table>
WOK
@manifest[:html] <<<<WOK
-<table summary="normal text css" width="90%" border="0" bgcolor="white" cellpadding="2" align="center">
-<tr><th class="left"><p class="bold"><a name="links">#{@translate.suggested_links}:</a></p></th></tr>
+<p class="bold"><a name="links">#{@translate.suggested_links}:</a></p>
+<table summary="suggested links" width="100%" border="0" bgcolor="white" cellpadding="2" align="center">
WOK
links_tests
@manifest[:html] <<<<WOK
@@ -606,7 +617,7 @@ WOK
WOK
@manifest[:html] <<<<WOK
<h2 class="small"><a name="languages">#{@translate.language_version_list}</a></h2>
-<table summary="normal text css" width="100%" border="0" bgcolor="white" cellpadding="2" align="center">
+<table summary="language versions" width="100%" border="0" bgcolor="white" cellpadding="2" align="center">
<tr> <th class="left"><p class="bold">#{@translate.filename}</p></th><th class="left"><p class="bold">#{@translate.description}</p></th><th class="right"><p class="right">&nbsp;</p></th></tr>
WOK
diff --git a/lib/sisu/v0/odf.rb b/lib/sisu/v0/odf.rb
index 03a94ce6..6b1491c2 100644
--- a/lib/sisu/v0/odf.rb
+++ b/lib/sisu/v0/odf.rb
@@ -441,6 +441,7 @@ module SiSU_ODF
data.each do |para|
#p para if para =~safe_characters and @md.cmd =~/V/ #KEEP
#para.gsub!(/&lt;(~\d+;(?:\w|[0-6]:)\d+;\w\d+)&gt;&lt;(#@dp:#@dp)&gt;/,'<\1><\2>')
+ para='' if para =~/#{Mx[:lv_o]}\d+:.*?#{Mx[:lv_c]}.+?#{Mx[:pa_non_object_dummy_heading]}/
para_array=[]
word=para.scan(/\S+|\n/)
if word
diff --git a/lib/sisu/v0/plaintext.rb b/lib/sisu/v0/plaintext.rb
index 9d25ed73..4dd808fc 100644
--- a/lib/sisu/v0/plaintext.rb
+++ b/lib/sisu/v0/plaintext.rb
@@ -378,10 +378,6 @@ WOK
#@plaintext[:owner_details]=formatMono.bold_para
#para=''
elsif para =~/(#{Mx[:tc_p]}|#{Mx[:gr_o]}Th?)/u #tables ! check
- #elsif para =~/(.*)<!#!>(.*)/
- # one,two=$1,$2
- # format_text=Format_text_object.new(one,two)
- # para=format_text.seg_no_paranum
end
para='' if (para =~/<a name="n\d+">/ \
and para =~/^(-\{{2}~\d+|<!e[:_]\d+!>)/) # -endnote
diff --git a/lib/sisu/v0/texpdf.rb b/lib/sisu/v0/texpdf.rb
index f86d8729..3cf560c4 100644
--- a/lib/sisu/v0/texpdf.rb
+++ b/lib/sisu/v0/texpdf.rb
@@ -344,6 +344,7 @@ module SiSU_TeX
# DEBUG 2003w16 this is a kludge, because i could not get parameters
# from param, Sort out ... revert to more elegant solution
# even more of a kludge as had to insert newlines where code is used not satisfactory, think about
+ para='' if para =~/#{Mx[:lv_o]}\d+:.*?#{Mx[:lv_c]}.+?#{Mx[:pa_non_object_dummy_heading]}/
para=if para =~/#{Mx[:br_nl]}|\n/; para.split(/#{Mx[:br_nl]}|\n/)
else para
end
@@ -438,7 +439,7 @@ module SiSU_TeX
end
elsif x =~/code/; @@flag_alt,@@flag_code=true,true
elsif @@flag_alt
- if para =~ /#{Mx[:lnk_c]}(?:https?|file|ftp)/m
+ if para =~ /(?:https?|file|ftp)/m
txt_obj={:txt =>para,:paper_size =>'a4'}
para=SiSU_TeX_Pdf::Format_text_object.new(@md,txt_obj).http
end
@@ -503,7 +504,7 @@ module SiSU_TeX
end
para
end
- if para =~ /#{Mx[:lnk_c]}(?:https?|file|ftp)/
+ if para =~ /(?:https?|file|ftp)/
para=if para !~/\.(?:png|jpg|gif)/
txt_obj={:txt =>para,:paper_size =>'a4'}
SiSU_TeX_Pdf::Format_text_object.new(@md,txt_obj).http
@@ -539,10 +540,12 @@ module SiSU_TeX
end
@tex_file <<<<WOK
#{@tex.header}#{@tex.footer}
-\\tolerance=500
+\\tolerance=300
+\\clubpenalty=300
+\\widowpenalty=300
\\makeatother
\\makeatother
-\\sloppy
+% \\sloppy
\\begin{document}
WOK
sisu_rc_footnote=if @md.sc_info; @tex.doc_sc_info_footnote_full
@@ -650,12 +653,12 @@ WOK
s_lnk.gsub!(/\s*(#{Mx[:br_line]}|#{Mx[:br_nl]}|#{Mx[:br_paragraph]})\s*/,' \\\\\\\\ ')
s_lnk.gsub!(/(?:\\)*([$&~%_#}{^])/,"\\\\\\1") #latex special chars
if url !~/^\.(\.)?\//
- s_lnk_url=%<\\begin{scriptsize}\\href{#{url}}{#{url}}\\end{scriptsize}> # note this bit of dereferencing magic
+ s_lnk_url=%<\\begin{scriptsize}\\url{#{url}}\\end{scriptsize}> # note this bit of dereferencing magic
else
url.gsub!(/\.\.\//,'')
s_lnk_url="(#{@tex.site}) \\\\\n" + ' ' +
"\\begin{scriptsize}" +
- %<\\href\{#{@vz.url_root_http}/#{url}\}\{#{@vz.url_root_http}/#{url}\}> + # note this bit of dereferencing magic
+ %<\\url\{#{@vz.url_root_http}/#{url}\}> + # note this bit of dereferencing magic
"\\end{scriptsize}"
end
@tex_file << " #{s_lnk} \\\\\n #{s_lnk_url} \n" unless @md.doc_skin =~/skin_mail/
diff --git a/lib/sisu/v0/texpdf_format.rb b/lib/sisu/v0/texpdf_format.rb
index c224d4aa..b6a1e1f2 100644
--- a/lib/sisu/v0/texpdf_format.rb
+++ b/lib/sisu/v0/texpdf_format.rb
@@ -461,9 +461,9 @@ para
@url_generic_rgx=/#{Mx[:lnk_o]}.+?#{Mx[:lnk_c]}(?:https?|file|ftp):\/\/\S+/
@words.each do |word|
@w << if word=~@url_generic_rgx
- if word =~/#{Mx[:lnk_o]}(?:.+?)#{Mx[:lnk_c]}(?:https?|file|ftp):\/\/\S+?\.[^'"><\s]+?(?:[;.,]?(?:\s|$)|(?:\s|$))/
- regx_url=%r/#{Mx[:lnk_o]}(.+?)#{Mx[:lnk_c]}((?:https?|file|ftp):\/\/\S+?\.[^'"><\s]+?)(?:[;.,]?(?:\s|$)|(?:\s|$))/
- punctuate=/#{Mx[:lnk_o]}.+?#{Mx[:lnk_c]}(?:https?|file|ftp):\/\/\S+?\.[^'"><\s]+?([;.,]?(?:\s|$))/.match(word).captures.join
+ if word =~/#{Mx[:lnk_o]}(?:.+?)#{Mx[:lnk_c]}(?:https?|file|ftp):\/\/\S+?\.[^'"\s]+?(?:[;.,]?(?:\s|$)|(?:\s|$))/
+ regx_url=%r/#{Mx[:lnk_o]}(.+?)#{Mx[:lnk_c]}((?:https?|file|ftp):\/\/\S+?\.[^'"\s]+?)(?:[;.,]?(?:\s|$)|(?:\s|$))/
+ punctuate=/#{Mx[:lnk_o]}.+?#{Mx[:lnk_c]}(?:https?|file|ftp):\/\/\S+?\.[^'"\s]+?([;.,]?(?:\s|$))/.match(word).captures.join
else
regx_url=%r/#{Mx[:lnk_o]}(.+?)#{Mx[:lnk_c]}((?:https?|file|ftp):\S+)/
punctuate=''
@@ -1042,14 +1042,14 @@ WOK
string.gsub!(/&\S+?;/,' ')
string.gsub!(/<a href=".+?">/,' ')
string.gsub!(/<\/a>/,' ')
- string.gsub!(/((?:^|\s)#{Mx[:lnk_c]})((?:https?|file|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?:\s|$))/,
+ string.gsub!(/((?:^|\s)#{Mx[:lnk_c]})((?:https?|file|ftp):\/\/\S+?\.[^'"\s]+?)([;.,]?(?:\s|$))/,
'\1\begin{scriptsize}\url{\2}\end{scriptsize}\3') #special case \{ e.g. \}http://url
string.gsub!(/[^\}>_]((?:https?|file|ftp):\/\/\S+?)(<\/\S>)/,
' \begin{scriptsize}\url{\1} \end{scriptsize}\2') #special case
string.gsub!(/\B(?:\\_|\\)((?:https?|file|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?:\s|$))/,
'\begin{scriptsize}\\url{\1}\end{scriptsize}\2') #specially escaped url no decoration
unless @@flag_code
- string.gsub!(/(^|#{Mx[:gl_c]}|\s)((?:https?|file|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?=\s|$))/,
+ string.gsub!(/(^|#{Mx[:gl_c]}|\s)((?:https?|file|ftp):\/\/\S+?\.[^'"\s]+?)([;.,]?(?=\s|$))/,
"\\1#{@url_brace.tex_open}\\begin{scriptsize}\\url{\\2}\\end{scriptsize}#{@url_brace.tex_close}\\3") #url matching with decoration <url> positive lookahead, sequence issue with { linked }http://url cannot use \b at start
else #code-block: angle brackets special characters, note _ already escaped
string.gsub!(/\\_</,'{\UseTextSymbol{OML}{<}}')
@@ -1100,7 +1100,7 @@ WOK
#string.gsub!(/<=lt>/,'\<')
#string.gsub!(/<=gt>/,'\>')
string.gsub!(/<=underscore>/,'\_')
- string.gsub!(/(\href\{http:\/\/\S+?)(?:(?:<=tilde>)(\S+))+\}/,'\1\~\2}') #tildes in urls \href treated differently from text
+ string.gsub!(/((?:\\href|\\url)\{http:\/\/\S+?)(?:(?:<=tilde>)(\S+))+\}/,'\1\~\2}') #tildes in urls \href treated differently from text
string.gsub!(/<=tilde>/,'{$\sim$}')
string.gsub!(/<=pipe>/,'{\textbar}')
string.gsub!(/<=caret>/,'{\^{~}}')
@@ -1209,14 +1209,14 @@ WOK
string.gsub!(/&\S+?;/,' ')
string.gsub!(/<a href=".+?">/,' ')
string.gsub!(/<\/a>/,' ')
- string.gsub!(/((?:^|\s)#{Mx[:lnk_c]})((?:https?|file|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?:\s|$))/,
+ string.gsub!(/((?:^|\s)#{Mx[:lnk_c]})((?:https?|file|ftp):\/\/\S+?\.[^'"\s]+?)([;.,]?(?:\s|$))/,
'\1\begin{scriptsize}\url{\2}\end{scriptsize}\3') #special case \{ e.g. \}http://url
string.gsub!(/[^\}>_]((?:https?|file|ftp):\/\/\S+?)(<\/\S>)/,
' \begin{scriptsize}\url{\1} \end{scriptsize}\2') #special case
- string.gsub!(/\B(?:\\_|\\)((?:https?|file|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?:\s|$))/,
+ string.gsub!(/\B(?:\\_|\\)((?:https?|file|ftp):\/\/\S+?\.[^'"\s]+?)([;.,]?(?:\s|$))/,
'\begin{scriptsize}\\url{\1}\end{scriptsize}\2') #specially escaped url no decoration
unless @@flag_code
- string.gsub!(/(^|#{Mx[:gl_c]}|\s)((?:https?|file|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?=\s|$))/,
+ string.gsub!(/(^|#{Mx[:gl_c]}|\s)((?:https?|file|ftp):\/\/\S+?\.[^'"\s]+?)([;.,]?(?=\s|$))/,
"\\1#{@url_brace.tex_open}\\begin{scriptsize}\\url{\\2}\\end{scriptsize}#{@url_brace.tex_close}\\3") #url matching with decoration <url> positive lookahead, sequence issue with { linked }http://url cannot use \b at start
else #code-block: angle brackets special characters, note _ already escaped
string.gsub!(/\\_</,'{\UseTextSymbol{OML}{<}}')
@@ -1271,7 +1271,7 @@ WOK
#string.gsub!(/<=lt>/,'\<')
#string.gsub!(/<=gt>/,'\>')
string.gsub!(/<=underscore>/,'\_')
- string.gsub!(/(\href\{http:\/\/\S+?)(?:(?:<=tilde>)(\S+))+\}/,'\1\~\2}') #tildes in urls \href treated differently from text
+ string.gsub!(/((?:\\href|\\url)?\{http:\/\/\S+?)(?:(?:<=tilde>)(\S+))+\}/,'\1\~\2}') #tildes in urls \href treated differently from text
string.gsub!(/<=tilde>/,'{$\sim$}')
string.gsub!(/<=pipe>/,'{\textbar}')
string.gsub!(/<=caret>/,'{\^{~}}')
diff --git a/lib/sisu/v0/xml.rb b/lib/sisu/v0/xml.rb
index 1fc6d221..4826a503 100644
--- a/lib/sisu/v0/xml.rb
+++ b/lib/sisu/v0/xml.rb
@@ -389,9 +389,6 @@ WOK
format_text.scr_inden_ocn_e_no_paranum
end
end
- if para !~/#{@vz.margin_txt_0}|#{@vz.margin_txt_1}|#{@vz.margin_txt_2}/
- # i don't get the condition for no paranum
- end
else #
end
para.gsub!(/#{Mx[:pa_o]}:\S+#{Mx[:pa_c]}/,'') if para