aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2011-11-21 00:11:52 -0500
committerRalph Amissah <ralph@amissah.com>2011-11-21 00:11:52 -0500
commitb19886a01a945ea846f51956ec201f9f32e1eca5 (patch)
treec02cb26b50a46bb505b3f8f0d7449e47f3f0bb69
parentv3: sisu manual, sisu markup, e.g. of link shortcut for multiple sisu documents (diff)
v3: param, sisupod_make, sisu markup embedded symbol images regex, case added
-rw-r--r--data/doc/sisu/CHANGELOG_v34
-rw-r--r--lib/sisu/v3/dal_syntax.rb2
-rw-r--r--lib/sisu/v3/param.rb3
-rw-r--r--lib/sisu/v3/sisupod_make.rb5
4 files changed, 10 insertions, 4 deletions
diff --git a/data/doc/sisu/CHANGELOG_v3 b/data/doc/sisu/CHANGELOG_v3
index 2baf851e..4943a61d 100644
--- a/data/doc/sisu/CHANGELOG_v3
+++ b/data/doc/sisu/CHANGELOG_v3
@@ -21,6 +21,10 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_3.1.5.orig.tar.xz
sisu_3.1.5-1.dsc
sisu_3.1.5-1.debian.tar.gz
+ * images, embedded symbol (previously overlooked, pre use of utf-8)
+ * param, sisu markup image regex match
+ * sisupod, sisu markup image regex match
+
* dal_expand_insertions, link shortcut for multiple versions of sisu document,
omit codeblocks
diff --git a/lib/sisu/v3/dal_syntax.rb b/lib/sisu/v3/dal_syntax.rb
index 3a943b75..e51316ed 100644
--- a/lib/sisu/v3/dal_syntax.rb
+++ b/lib/sisu/v3/dal_syntax.rb
@@ -342,7 +342,7 @@ module SiSU_Syntax
end
end
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+?)>/,'{ c_\1.png 14x14 }image')
dob.obj.gsub!(/<!(\S+)!>/,'<:\1>') #escaped special character
dob.obj.gsub!(/&nbsp;/,"#{Mx[:nbsp]}") #escaped special character
dob.obj.gsub!(/\\~/,"#{Mx[:gl_o]}#126#{Mx[:gl_c]}") #escaped special character
diff --git a/lib/sisu/v3/param.rb b/lib/sisu/v3/param.rb
index ef8e9389..045fd767 100644
--- a/lib/sisu/v3/param.rb
+++ b/lib/sisu/v3/param.rb
@@ -966,7 +966,7 @@ module SiSU_Param
@lang_code_insert=(@opt.dir_structure_by =~/language/) \
? ''
: ".#{@opt.lng}"
- @rgx_image=/(?:^|[^_\\])\{\s*(\S+?\.(?:png|jpg|gif))/
+ @rgx_image=/(?:^|[^_\\])\{(?:\s*|\~\^\s+)(\S+?\.(?:png|jpg|gif)\b)/m
@rgx_audio=/\{\s*(\S+?\.(?:mp3|ogg))/
@rgx_mm=/\{\s*(\S+?\.(?:ogg|mpeg))/ #expand and distinguish ogg
begin
@@ -1272,6 +1272,7 @@ module SiSU_Param
end
end
end
+ para.gsub!(/<:=(\S+?)>/,'{ c_\1.png 14x14 }image') # embedded symbol (image)
if para !~/^%+\s/ \
and para =~@rgx_image
@ec[:image] << para.scan(@rgx_image).uniq
diff --git a/lib/sisu/v3/sisupod_make.rb b/lib/sisu/v3/sisupod_make.rb
index b154bc1d..e4423641 100644
--- a/lib/sisu/v3/sisupod_make.rb
+++ b/lib/sisu/v3/sisupod_make.rb
@@ -160,8 +160,8 @@ module SiSU_Doc
end
@skin
end
- def images_extract(f,images)
- rgx_image=/(?:^|[^_\\])\{\s*(\S+?\.(?:png|jpg|gif))/
+ def images_extract(f,images) # consider using param info
+ rgx_image=/(?:^|[^_\\])\{(?:\s*|\~\^\s+)(\S+?\.(?:png|jpg|gif)\b)/m
if f !~/^%+\s/ \
and f =~rgx_image
images << f.scan(rgx_image).uniq
@@ -183,6 +183,7 @@ module SiSU_Doc
file_array.each do |f| #% work area
if f !~/^%+\s/
skin << f.scan(@rgx_skin).uniq.flatten if f =~@rgx_skin
+ f.gsub!(/<:=(\S+?)>/,'{ c_\1.png 14x14 }image') # embedded symbol (image)
if f !~/^%+\s/ \
and f =~@rgx_image
images=images_extract(f,images)