aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v0/shared_txt.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2007-10-15 19:27:16 +0100
committerRalph Amissah <ralph@amissah.com>2007-10-15 19:27:16 +0100
commite1ec4bd2dad2bd22ad97cea398ae1cfcfae183a2 (patch)
tree6ffe3ae1b2453578a032ce053934a31f980645e9 /lib/sisu/v0/shared_txt.rb
parentregex matching of images, (and rearrangement of conditionals) (diff)
mostly the arrangement of conditionals
Diffstat (limited to 'lib/sisu/v0/shared_txt.rb')
-rw-r--r--lib/sisu/v0/shared_txt.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/sisu/v0/shared_txt.rb b/lib/sisu/v0/shared_txt.rb
index 6af436b0..e5acf36d 100644
--- a/lib/sisu/v0/shared_txt.rb
+++ b/lib/sisu/v0/shared_txt.rb
@@ -81,15 +81,18 @@ module SiSU_text_utils
word="\n"
@n_char_max_extend = @n_char_max + out[line].length
line=line
- elsif (out[line].length + word.length) > (@n_char_max_extend - @n_indent) and out[line] =~/\S+/
+ elsif (out[line].length + word.length) > (@n_char_max_extend - @n_indent) \
+ and out[line] =~/\S+/
@n_char_max_extend = @n_char_max
out[line].squeeze!(' ')
line += 1
end
if word
- out[line]=if out[line] and out[line] !~/\S+$/m
+ out[line]=if out[line] \
+ and out[line] !~/\S+$/m
"#{out[line]}#{word}"
- elsif out[line] and out[line] =~/\S+/
+ elsif out[line] \
+ and out[line] =~/\S+/
"#{out[line]} #{word}"
else "#{word.strip}"
end
@@ -114,7 +117,8 @@ module SiSU_text_utils
@md,@p=md,para
end
def extract(tag,tag_content,type,attrib)
- dc=if dc_tag and dc_content
+ dc=if dc_tag \
+ and dc_content
[dc_tag,dc_content,{dc_tag=>dc_content}]
else nil
end