From 45acf3b71d8f04ffb608ae2c9ba9e0da6030e66d Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 16 Oct 2007 01:14:39 +0100 Subject: image list, extracting conditions and regex visited --- lib/sisu/v0/composite.rb | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'lib/sisu/v0/composite.rb') diff --git a/lib/sisu/v0/composite.rb b/lib/sisu/v0/composite.rb index ebad049e..4366b3ef 100644 --- a/lib/sisu/v0/composite.rb +++ b/lib/sisu/v0/composite.rb @@ -157,7 +157,8 @@ module SiSU_Assemble elsif i =~/^\}code/; false else @code_flag end - unless @code_flag + if not @code_flag \ + and i !~/^%+\s/ i.gsub!(/^([123]|:?[ABC])~\? /,'% [conditional heading:] \1~ ') #off conditional heading (consider syntax) if i =~/^0~|^@\S+?:/ i.gsub!(/\n/m,"\n% ") @@ -166,11 +167,17 @@ module SiSU_Assemble end end file[:prepared] << i - file[:images] << i.scan(rgx_image).uniq if i =~rgx_image #flag + if i !~/^%+\s/ \ + and i =~rgx_image + file[:images] << i.scan(rgx_image).uniq + end end file[:prepared] << "\n% end import" << "\n\n" - file[:images].uniq! if file[:images].length > 0 - file[:images].flatten! if file[:images].length > 0 + if file[:images].length > 0 + file[:images].flatten! + file[:images].uniq! + file[:images].delete_if {|x| x =~/http:\/\// } + end file end def insertions? -- cgit v1.2.3