aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v0/odf.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2007-09-03 21:46:47 +0100
committerRalph Amissah <ralph@amissah.com>2007-09-03 21:46:47 +0100
commit2cd558f67f44cca787013c02b665533b97c90f0e (patch)
treeb3b596e2d094014b897dabd1c93e91623b1663d0 /lib/sisu/v0/odf.rb
parentsisu-0.57.0 md5s (diff)
sisu-0.58 work towards making it possible to describe sisu and sisu markup within sisu
Diffstat (limited to 'lib/sisu/v0/odf.rb')
-rw-r--r--lib/sisu/v0/odf.rb14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/sisu/v0/odf.rb b/lib/sisu/v0/odf.rb
index 11d14bf2..16cea2f4 100644
--- a/lib/sisu/v0/odf.rb
+++ b/lib/sisu/v0/odf.rb
@@ -378,6 +378,7 @@ module SiSU_ODF
parray=[]
para.split(/<:?br(?: \/)?>/).each do |parablock|
parablock=group_clean(parablock)
+ parablock.gsub!(/^\s*$/,'<br />')
parablock.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
parray << %{<text:p text:style-name="P5">#{parablock}</text:p>} if parablock =~/\S+/
@@ -398,8 +399,11 @@ module SiSU_ODF
lv=nil if lv == 0
#extract_endnotes(para)
#para=fontface(para)
- para=if para =~/\{\s*\S+?\.(?:png|jpg|gif)\s.+?\}(?:(?:https?|ftp):\S+|image)/; image(para)
- elsif para =~/\{.+?\}(?:(?:https?|ftp):\S+|image)/; text_link(para)
+ para=unless para=~/^<:code>/
+ para=if para =~/\{\s*\S+?\.(?:png|jpg|gif)\s.+?\}(?:(?:https?|ftp):\S+|image)/; image(para)
+ elsif para =~/\{.+?\}(?:(?:https?|ftp):\S+|image)/; text_link(para)
+ else para
+ end
else para
end
para=footnote(para)
@@ -446,8 +450,8 @@ module SiSU_ODF
(4..6).each { |x| @odf_contents_close[x]='' }
odf_tail #($1,$2)
fix=[]
- bullet=image_src('bullet_red.png')
- cp("#{bullet}/bullet_red.png","#{@env.path.odf}/Pictures/.") #if image_src('bullet_red.png')
+ bullet=image_src('bullet_09.png')
+ cp("#{bullet}/bullet_09.png","#{@env.path.odf}/Pictures/.") #if image_src('bullet_09.png')
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>')
@@ -465,7 +469,7 @@ module SiSU_ODF
para=para_array.join(' ')
para=para.strip
end
- para.gsub!(/^(<:i[1-9]>\s+)?_\*\s+/,'\1<draw:frame draw:style-name="gr1" text:anchor-type="as-char" svg:width="0.22cm" svg:height="0.22cm" draw:z-index="2"><draw:image xlink:href="Pictures/bullet_red.png" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/></draw:frame> ') # bullet_red.png
+ para.gsub!(/^(<:i[1-9]>\s+)?_\*\s+/,'\1<draw:frame draw:style-name="gr1" text:anchor-type="as-char" svg:width="0.22cm" svg:height="0.22cm" draw:z-index="2"><draw:image xlink:href="Pictures/bullet_09.png" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/></draw:frame> ') # bullet_09.png
#para.gsub!(/^(<:i[1-9]>\s+)?_\*\s+/,'\1<text:span text:style-name="T6">●</text:span> ') #bullet
#para.gsub!(/^(<:i[1-9]>\s+)?_\*\s+/,'\1● ') # bullet utf8, make smaller if used
#para.gsub!(/^_\*\s+/,'<text:span text:style-name="T6">●</text:span> ') #bullet