aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v0/composite.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v0/composite.rb')
-rw-r--r--lib/sisu/v0/composite.rb15
1 files changed, 11 insertions, 4 deletions
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?