diff options
author | Ralph Amissah <ralph@amissah.com> | 2007-09-04 19:00:10 +0100 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2007-09-04 19:00:10 +0100 |
commit | f153bba37dafeae0de7f5bca633e8e8c1085434d (patch) | |
tree | 9e2293fee4e56e417ada00e484f3738140a15e2a /lib | |
parent | code-block exceptions (diff) |
grouped text, pdf indents and size
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sisu/v0/plaintext.rb | 3 | ||||
-rw-r--r-- | lib/sisu/v0/texpdf.rb | 11 |
2 files changed, 13 insertions, 1 deletions
diff --git a/lib/sisu/v0/plaintext.rb b/lib/sisu/v0/plaintext.rb index d88d6194..ddcf3a42 100644 --- a/lib/sisu/v0/plaintext.rb +++ b/lib/sisu/v0/plaintext.rb @@ -322,6 +322,9 @@ WOK para.gsub!(/<b>(.+?)<\/b>/,'*\1*') para.gsub!(/<u>(.+?)<\/u>/,'_\1_') if para =~/<:(?:group|verse|alt|code)(?:-end)?>(?:\s+<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>)?/ + if para =~/<:code>/ + para.gsub!(/_</,'<'); para.gsub!(/_>/m,'>') #code-block: angle brackets special characters + end para.gsub!(/<br(?: \/)?>/,"\n") # watch para.gsub!(/<:(?:group|verse|alt|code)(?:-end)?>(?:\s+<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>)?/,'') end diff --git a/lib/sisu/v0/texpdf.rb b/lib/sisu/v0/texpdf.rb index 4faab502..cd4c2ec1 100644 --- a/lib/sisu/v0/texpdf.rb +++ b/lib/sisu/v0/texpdf.rb @@ -459,7 +459,16 @@ WOK else '' end para.gsub!(regx,'') - @group_collect.each{ |x| x.gsub!(/(<:\S+>|<!.*?!>|<!>)/,' ') } + #@group_collect.each{ |x| x.gsub!(/(<:\S+>|<!.*?!>|<!>)/,' ') } + group_collect=[] + group_collect << '\begin{footnotesize} ' unless @@flag_code + @group_collect.each do |x| + x.gsub!(/(<:\S+>|<!.*?!>|<!>)/,' ') + x=x.split(/ \\\\ /) + group_collect << x + end + group_collect << ' \end{footnotesize} ' unless @@flag_code + @group_collect=group_collect.flatten @lineone.gsub!(/(<:\S+>|<!.*?!>|<!>)/,' ') #@group_collect.each{ |x| x.gsub!(/(.#{@@tilde}\S*\s*|<:\S+>|<!.*?!>|<!>)/,' ') } #@lineone.gsub!(/(.#{@@tilde}\S*\s*|<:\S+>|<!.*?!>|<!>)/,' ') |