aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2007-07-31 21:15:01 +0100
committerRalph Amissah <ralph@amissah.com>2007-07-31 21:15:01 +0100
commit5aa5fb54771a8e6ec9c6bbc292e0b06c00db9a96 (patch)
treeb94692969cd8a2a38606e97417837be8be88d9c0
parentchangelog and version updated (diff)
odf regex matches, 0.56.2
-rw-r--r--CHANGELOG15
-rw-r--r--lib/sisu/v0/odf.rb8
2 files changed, 17 insertions, 6 deletions
diff --git a/CHANGELOG b/CHANGELOG
index b7f3df00..d8d5e4ff 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -6,11 +6,20 @@ Reverse Chronological:
%% STABLE MANIFEST
+%% sisu_0.56.2.orig.tar.gz (2007-07-31:31/2)
+http://www.jus.uio.no/sisu/pkg/src/sisu_0.56.2.orig.tar.gz
+ sisu_0.56.2.orig.tar.gz
+ sisu_0.56.2-1.dsc
+ sisu_0.56.2-1.diff.gz
+
+ * odf, a few regex matches, a new fix (url), and an old one (grouped text
+ with change to fontface)
+
%% sisu_0.56.1.orig.tar.gz (2007-07-31:31/2)
http://www.jus.uio.no/sisu/pkg/src/sisu_0.56.1.orig.tar.gz
- sisu_0.56.1.orig.tar.gz
- sisu_0.56.1-1.dsc
- sisu_0.56.1-1.diff.gz
+ 6740ed538a5558cead0228315b811d9f 1272026 sisu_0.56.1.orig.tar.gz
+ 1270f327c735cca3ea077950e5229f25 606 sisu_0.56.1-1.dsc
+ 87e12b0b18192346e4a98c3127a73968 142382 sisu_0.56.1-1.diff.gz
* dal, endnote / url matching refinement
diff --git a/lib/sisu/v0/odf.rb b/lib/sisu/v0/odf.rb
index 381e23d4..f6d6d942 100644
--- a/lib/sisu/v0/odf.rb
+++ b/lib/sisu/v0/odf.rb
@@ -279,7 +279,7 @@ module SiSU_ODF
end
def text_link(para)
para.gsub!(@serial,'')
- m=para.scan(/(\{([^}]+?)\}((?:https?|ftp)\S+?))([;.,]?$)/) #sort
+ m=para.scan(/(\{([^}]+?)\}((?:https?|ftp)\S+?))([;.,]?(?=\s|$))/) #sort
if m
m.each do |i|
txt,url,trail=i[1],i[2]
@@ -297,8 +297,8 @@ module SiSU_ODF
para.gsub!(@serial,'')
para.gsub!(/\b[_\\]((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?:\s|$))/,
%{<text:a xlink:type="simple" xlink:href="\\1">\\1</text:a>\\2}) #http ftp matches escaped, no decoration
- para.gsub!(/((?:^|\s)[}])((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?:\s|$))/,
- %{\\1<text:a xlink:type="simple" xlink:href="\\2">\\2</text:a>\\3}) #special case \{ e.g. \}http://url
+ para.gsub!(/((?:^|\s)[}])((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?=\s|$))/,
+ '\1<text:a xlink:type="simple" xlink:href="\2">\2</text:a>\3') #special case \{ e.g. \}http://url
para.gsub!(/(^|\s)((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?=\s|$))/,
%{\\1#{@url_brace.xml_open}<text:a xlink:type="simple" xlink:href="\\2">\\2</text:a>#{@url_brace.xml_close}\\3}) #http ftp matches with decoration
#para.gsub!(/\b((?:https?|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?:\s|$))/, also works
@@ -346,6 +346,7 @@ module SiSU_ODF
def group_clean(para)
para.gsub!(/&amp;nbsp;|&nbsp;/,'&#160;')
para.gsub!(/</,'&lt;'); para.gsub!(/>/,'&gt;')
+ para.gsub!(/&lt;(text:span text:style-name="T[1-5]"|\/text:span)&gt;/,'<\1>') #works, not ideal
para.gsub!(/&lt;br(?:\s+\/)?&gt;/,'<br />')
#para.gsub!(/\s\s/,'&#160;&#160;')
para
@@ -382,6 +383,7 @@ module SiSU_ODF
parray << %{<text:p text:style-name="P5">#{parablock}</text:p>} if parablock =~/\S+/
end
para=parray.join + '<text:p text:style-name="Standard"/>'
+ para
end
def table(para) #
if para =~/<!Th?.+/ # tables come as single block