From a97f505ae72c3dfa7b11bfd637d8e31ef046983a Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 2 Feb 2008 12:33:12 +0000 Subject: for update replace LIKE with '=' ; required by pg8.3 bigint --- lib/sisu/v0/db_remove.rb | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v0/db_remove.rb b/lib/sisu/v0/db_remove.rb index 867f5d22..f84e3e05 100644 --- a/lib/sisu/v0/db_remove.rb +++ b/lib/sisu/v0/db_remove.rb @@ -72,19 +72,19 @@ module SiSU_DB_remove del_id=del.join #@conn.execute("BEGIN") @conn.execute(%{ - DELETE FROM endnotes WHERE metadata_tid LIKE '#{del_id}'; - DELETE FROM endnotes_asterisk WHERE metadata_tid LIKE '#{del_id}'; - DELETE FROM endnotes_plus WHERE metadata_tid LIKE '#{del_id}'; - DELETE FROM documents WHERE metadata_tid LIKE '#{del_id}'; - DELETE FROM urls WHERE metadata_tid LIKE '#{del_id}'; - DELETE FROM metadata WHERE tid LIKE '#{del_id}'; + DELETE FROM endnotes WHERE metadata_tid = '#{del_id}'; + DELETE FROM endnotes_asterisk WHERE metadata_tid = '#{del_id}'; + DELETE FROM endnotes_plus WHERE metadata_tid = '#{del_id}'; + DELETE FROM documents WHERE metadata_tid = '#{del_id}'; + DELETE FROM urls WHERE metadata_tid = '#{del_id}'; + DELETE FROM metadata WHERE tid = '#{del_id}'; /* - DELETE FROM documents WHERE documents.metadata_tid LIKE '#{del_id}'; - DELETE FROM endnotes WHERE endnotes.metadata_tid LIKE '#{del_id}'; - DELETE FROM endnotes_asterisk WHERE endnotes_asterisk.metadata_tid LIKE '#{del_id}'; - DELETE FROM endnotes_plus WHERE endnotes_plus.metadata_tid LIKE '#{del_id}'; - DELETE FROM urls WHERE urls.metadata_tid LIKE '#{del_id}'; - DELETE FROM metadata WHERE metadata.tid LIKE '#{del_id}'; + DELETE FROM documents WHERE documents.metadata_tid = '#{del_id}'; + DELETE FROM endnotes WHERE endnotes.metadata_tid = '#{del_id}'; + DELETE FROM endnotes_asterisk WHERE endnotes_asterisk.metadata_tid = '#{del_id}'; + DELETE FROM endnotes_plus WHERE endnotes_plus.metadata_tid = '#{del_id}'; + DELETE FROM urls WHERE urls.metadata_tid = '#{del_id}'; + DELETE FROM metadata WHERE metadata.tid = '#{del_id}'; */ }) #@conn.execute("COMMIT") -- cgit v1.2.3 From 4c36cadd7fef8b4bbdb0f423bdc4b7c7365d5699 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 5 Feb 2008 05:02:54 +0000 Subject: ruby 1.9 open; future pgsql testing on 8.3; encoding utf-8 checks; version bump 0.65.0 * ruby 1.9 use opened, testing required * db sql pgsql future testing on version 8.3 * encoding utf-8 some compatibility checks --- lib/sisu/v0/dal.rb | 18 +- lib/sisu/v0/dal_doc_str.rb | 2 +- lib/sisu/v0/dal_doc_str_tables.rb | 24 ++- lib/sisu/v0/db_import.rb | 8 +- lib/sisu/v0/html_format.rb | 2 +- lib/sisu/v0/html_segments.rb | 4 +- lib/sisu/v0/html_table.rb | 22 +-- lib/sisu/v0/html_tune.rb | 172 +++++++++---------- lib/sisu/v0/manpage.rb | 4 +- lib/sisu/v0/odf.rb | 12 +- lib/sisu/v0/odf_format.rb | 26 +-- lib/sisu/v0/plaintext.rb | 4 +- lib/sisu/v0/shared_html_lite.rb | 12 +- lib/sisu/v0/shared_xml.rb | 336 +++++++++++++++++++------------------- lib/sisu/v0/sysenv.rb | 25 ++- lib/sisu/v0/texinfo.rb | 4 +- lib/sisu/v0/texinfo_format.rb | 26 +-- lib/sisu/v0/texpdf.rb | 6 +- lib/sisu/v0/texpdf_format.rb | 46 +++--- lib/sisu/v0/wikispeak.rb | 4 +- lib/sisu/v0/xml_tables.rb | 38 ++--- 21 files changed, 412 insertions(+), 383 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v0/dal.rb b/lib/sisu/v0/dal.rb index 6bd11568..e31dba69 100644 --- a/lib/sisu/v0/dal.rb +++ b/lib/sisu/v0/dal.rb @@ -138,7 +138,11 @@ module SiSU_DAL end def read_fnm dal=[] - dal=if FileTest.file?(@fnm); File.open(@fnm){ |f| dal=Marshal.load(f)} + dal=if FileTest.file?(@fnm) + if RUBY_VERSION < '1.9' + File.open(@fnm){ |f| dal=Marshal.load(f)} + else File.open(@fnm,'r:utf-8'){ |f| dal=Marshal.load(f)} + end else SiSU_DAL::Source.new(@opt).create_dal end end @@ -236,12 +240,12 @@ module SiSU_DAL para.gsub!(/
/,'
') #needed by xml, xhtml etc. #para.gsub!(/

/,'

') #consider para.gsub!(/`/,"'") - para.gsub!(/\342\200\231/,"'") #if para =~/’/ #Avoid #‘ ’ #“ ” para.gsub!(/\t/,' ') - para.gsub!(/�/,' ') #watch, replace with char code - para.gsub!(/[“”]/,'""') - para.gsub!(/[­–—]/,'-') #— – chk - para.gsub!(/·/,'*') + para.gsub!(/\342\200\231/u,"'") #if para =~/’/ #Avoid #‘ ’ #“ ” + para.gsub!(/�/u,' ') #watch, replace with char code + para.gsub!(/[“”]/u,'""') + para.gsub!(/[­–—]/u,'-') #— – chk + para.gsub!(/·/u,'*') para.gsub!(/\\copy(?:right)?\b/,'©') para.gsub!(/\\trademark\b|\\tm\b/,'®') #non_utf8(para) @@ -519,7 +523,7 @@ module SiSU_DAL @tuned_file=[] data.each do |para| para.gsub!(/(^|[^<][^v][^>])\n/,'\1 ') #messy, but idea is that tables should retain breaks - para.gsub!(/^/,"\n") unless para =~/¡/ + para.gsub!(/^/,"\n") unless para =~/¡/u para.gsub!(/^\s+|\s$/,"\n") @tuned_file << para end diff --git a/lib/sisu/v0/dal_doc_str.rb b/lib/sisu/v0/dal_doc_str.rb index a59800c4..68529c38 100644 --- a/lib/sisu/v0/dal_doc_str.rb +++ b/lib/sisu/v0/dal_doc_str.rb @@ -228,7 +228,7 @@ module SiSU_document_structure end para.gsub!(/\n\n/,"\n") if para =~/<:(?:code|verse|alt|group)>/ #newlines taken out para.gsub!(/(<:(?:code-end)>)/,"\n\\1") if para =~/<:(?:code-end)>/ #newlines added check - if para =~//,"\\1~#{o[:ocn]};#{o[:lv]};#{o[:type]}>") + if para =~//u,"\\1~#{o[:ocn]};#{o[:lv]};#{o[:type]}>") end @o_array << Struct.new(o).structure if o end diff --git a/lib/sisu/v0/dal_doc_str_tables.rb b/lib/sisu/v0/dal_doc_str_tables.rb index 7289543e..fd5d6fe4 100644 --- a/lib/sisu/v0/dal_doc_str_tables.rb +++ b/lib/sisu/v0/dal_doc_str_tables.rb @@ -96,9 +96,9 @@ module SiSU_document_structure_tables w=widths.split(/;/) tuned_file=[] tuned_file << if para =~/\{(?:t|table)~h(?:\sc\d+;)?[\d; ]*\}/ - "" + "" elsif para =~/\{(?:t|table)(?:\sc\d+;)?[\d; ]*\}/ - "" + "" end @row.each do |l| l << '' if l.length == (@row[1].length - 1) @@ -109,9 +109,9 @@ module SiSU_document_structure_tables l.each do |c| n +=1 #'' + c + '' table << if c =~/\A(?:\n)?\s*\Z/ - "¡¡#{w[n]}¡" + ' ' + "#{TS1}#{TS1}#{w[n]}#{TS1}" + ' ' else - "¡¡#{w[n]}¡" + c.strip + "#{TS1}#{TS1}#{w[n]}#{TS1}" + c.strip end end table << '!>' #'' @@ -140,8 +140,8 @@ module SiSU_document_structure_tables instructions=$1 @@column=instructions.split(/;\s*/) @@columns=@@column[0] - para.gsub!(/^table\{~h\s+(c\d+?;.+?)$/,'') - para.gsub!(/^table\{\s+(c\d+?;.+?)$/,'') + para.gsub!(/^table\{~h\s+(c\d+?;.+?)$/,"") + para.gsub!(/^table\{\s+(c\d+?;.+?)$/,"") @@flag['table_to']=true end if @@flag['table_to'] \ @@ -160,10 +160,10 @@ module SiSU_document_structure_tables and para =~/\S/ @@counter=1 sub_array=para.dup - @@line_mode=sub_array.scan(/.+/) + @@line_mode=sub_array.scan(/.+/u) Tables.new(@md,@@line_mode).tr_td para=@@line_mode.join - para.gsub!(/(.*\S+.*)\Z/m,'') unless para =~/') unless para =~/|)/ - line.gsub!(/(.+)/,"¡¡#{@@column[@@counter]}¡\\1") unless line =~/(\d+)<\/sup>/,'[\1]') string.gsub!(/<:i[12]>/,'') string.gsub!(/(?: \\;)+/,' ') - string.gsub!(//,"[TABLE]\n") #tables - string.gsub!(//,'\1') #tables - string.gsub!(/¡¡\d+¡/,' ') #tables - string.gsub!(/¡/,' ') #tables tidy later + string.gsub!(//u,"[TABLE]\n") #tables + string.gsub!(//u,'\1') #tables + string.gsub!(/¡¡\d+¡/u,' ') #tables + string.gsub!(/¡/u,' ') #tables tidy later string.gsub!(/<.+?>/,'') string.gsub!(/\{.+?\.(?:png|jpg|gif).+?\}(?:https?|file|ftp)\\\:\S+ /,' [image] ') # else image names found in search string.gsub!(/\s\s+/,' ') diff --git a/lib/sisu/v0/html_format.rb b/lib/sisu/v0/html_format.rb index d973ff5d..4ca2ff96 100644 --- a/lib/sisu/v0/html_format.rb +++ b/lib/sisu/v0/html_format.rb @@ -980,7 +980,7 @@ WOK @format,parablock=txt[0],txt[1] @parablock=parablock ##performance hit does not justify action: - #@parablock=if parablock=~/\S+/ and parablock !~/.*/]; @@get_hash_to=$1 if m # changed 2002w42, again w44 ! & again 2003w16 m=para[/^4~(\S+)/]; @@get_hash_fn=$1 if m - para=if para =~//m; para.split(/\n/) + para=if para =~//um; para.split(/\n/) else para end if para.class == String @@ -323,7 +323,7 @@ module SiSU_HTML_seg end else para end - elsif para =~/¡|/,1] @@tablefoot << m if m @parablock.gsub!(//,'') - @@tablehead=1 if @parablock =~//; @parablock=table_head($1) + @@tablehead=1 if @parablock =~//u; @parablock=table_head($1) end if @parablock =~// tablefoot=[] @@ -112,12 +112,12 @@ module SiSU_HTML_table end end if @@tablehead == 1 - if @parablock =~/¡¡/ - if @parablock =~// @parablock.gsub!(/!>/,table_row_close(true)) @@ -126,11 +126,11 @@ module SiSU_HTML_table end @parablock else - if @parablock =~// @parablock.gsub!(/!>/,table_row_close) diff --git a/lib/sisu/v0/html_tune.rb b/lib/sisu/v0/html_tune.rb index 9e8203bd..43b0fe70 100644 --- a/lib/sisu/v0/html_tune.rb +++ b/lib/sisu/v0/html_tune.rb @@ -88,7 +88,7 @@ module SiSU_Tune data=[] @data.each{|x| x.strip; data << x if not x.empty?} #1.9 array? data.each do |para| - @filename_tune.puts para, "\n" #if para !~/¡/ + @filename_tune.puts para, "\n" #if para !~/¡/u end end def marshal @@ -102,91 +102,91 @@ module SiSU_Tune @html=html end def clean - @html.gsub!(/¢/,'¢') # ¢ - @html.gsub!(/£/,'£') # £ - @html.gsub!(/¥/,'¥') # ¥ - @html.gsub!(/§/,'§') # § - @html.gsub!(/©/,'©') # © - @html.gsub!(/ª/,'ª') # ª - @html.gsub!(/«/,'«') # « - @html.gsub!(/®/,'®') # ® - @html.gsub!(/°/,'°') # ° - @html.gsub!(/±/,'±') # ± - @html.gsub!(/²/,'²') # ² - @html.gsub!(/³/,'³') # ³ - @html.gsub!(/µ/,'µ') # µ - @html.gsub!(/¶/,'¶') # ¶ - @html.gsub!(/¹/,'¹') # ¹ - @html.gsub!(/º/,'º') # º - @html.gsub!(/»/,'»') # » - @html.gsub!(/¼/,'¼') # ¼ - @html.gsub!(/½/,'½') # ½ - @html.gsub!(/¾/,'¾') # ¾ - @html.gsub!(/×/,'×') # × - @html.gsub!(/÷/,'÷') # ÷ - @html.gsub!(/¿/,'¿') # ¿ - @html.gsub!(/À/,'À') # À - @html.gsub!(/Á/,'Á') # Á - @html.gsub!(/Â/,'Â') # Â - @html.gsub!(/Ã/,'Ã') # Ã - @html.gsub!(/Ä/,'Ä') # Ä - @html.gsub!(/Å/,'Å') # Å - @html.gsub!(/Æ/,'Æ') # Æ - @html.gsub!(/Ç/,'Ç') # Ç - @html.gsub!(/È/,'È') # È - @html.gsub!(/É/,'É') # É - @html.gsub!(/Ê/,'Ê') # Ê - @html.gsub!(/Ë/,'Ë') # Ë - @html.gsub!(/Ì/,'Ì') # Ì - @html.gsub!(/Í/,'Í') # Í - @html.gsub!(/Î/,'Î') # Î - @html.gsub!(/Ï/,'Ï') # Ï - @html.gsub!(/Ð/,'Ð') # Ð - @html.gsub!(/Ñ/,'Ñ') # Ñ - @html.gsub!(/Ò/,'Ò') # Ò - @html.gsub!(/Ó/,'Ó') # Ó - @html.gsub!(/Ô/,'Ô') # Ô - @html.gsub!(/Õ/,'Õ') # Õ - @html.gsub!(/Ö/,'Ö') # Ö - @html.gsub!(/Ø/,'Ø') # Ø - @html.gsub!(/Ù/,'Ù') # Ù - @html.gsub!(/Ú/,'Ú') # Ú - @html.gsub!(/Û/,'Û') # Û - @html.gsub!(/Ü/,'Ü') # Ü - @html.gsub!(/Ý/,'Ý') # Ý - @html.gsub!(/Þ/,'Þ') # Þ - @html.gsub!(/ß/,'ß') # ß - @html.gsub!(/à/,'à') # à - @html.gsub!(/á/,'á') # á - @html.gsub!(/â/,'â') # â - @html.gsub!(/ã/,'ã') # ã - @html.gsub!(/ä/,'ä') # ä - @html.gsub!(/å/,'å') # å - @html.gsub!(/æ/,'æ') # æ - @html.gsub!(/ç/,'ç') # ç - @html.gsub!(/è/,'è') # è - @html.gsub!(/é/,'é') # é - @html.gsub!(/ê/,'ê') # ê - @html.gsub!(/ë/,'ë') # ë - @html.gsub!(/ì/,'ì') # ì - @html.gsub!(/í/,'í') # í - @html.gsub!(/î/,'î') # î - @html.gsub!(/ï/,'ï') # ï - @html.gsub!(/ð/,'ð') # ð - @html.gsub!(/ñ/,'ñ') # ñ - @html.gsub!(/ò/,'ò') # ò - @html.gsub!(/ó/,'ó') # ó - @html.gsub!(/ô/,'ô') # ô - @html.gsub!(/õ/,'õ') # õ - @html.gsub!(/ö/,'ö') # ö - @html.gsub!(/ø/,'ø') # ø - @html.gsub!(/ù/,'ù') # ú - @html.gsub!(/ú/,'ú') # û - @html.gsub!(/û/,'û') # ü - @html.gsub!(/ü/,'ü') # ý - @html.gsub!(/þ/,'þ') # þ - @html.gsub!(/ÿ/,'ÿ') # ÿ - @html.gsub!(/ý/,'ý') + @html.gsub!(/¢/u,'¢') # ¢ + @html.gsub!(/£/u,'£') # £ + @html.gsub!(/¥/u,'¥') # ¥ + @html.gsub!(/§/u,'§') # § + @html.gsub!(/©/u,'©') # © + @html.gsub!(/ª/u,'ª') # ª + @html.gsub!(/«/u,'«') # « + @html.gsub!(/®/u,'®') # ® + @html.gsub!(/°/u,'°') # ° + @html.gsub!(/±/u,'±') # ± + @html.gsub!(/²/u,'²') # ² + @html.gsub!(/³/u,'³') # ³ + @html.gsub!(/µ/u,'µ') # µ + @html.gsub!(/¶/u,'¶') # ¶ + @html.gsub!(/¹/u,'¹') # ¹ + @html.gsub!(/º/u,'º') # º + @html.gsub!(/»/u,'»') # » + @html.gsub!(/¼/u,'¼') # ¼ + @html.gsub!(/½/u,'½') # ½ + @html.gsub!(/¾/u,'¾') # ¾ + @html.gsub!(/×/u,'×') # × + @html.gsub!(/÷/u,'÷') # ÷ + @html.gsub!(/¿/u,'¿') # ¿ + @html.gsub!(/À/u,'À') # À + @html.gsub!(/Á/u,'Á') # Á + @html.gsub!(/Â/u,'Â') # Â + @html.gsub!(/Ã/u,'Ã') # Ã + @html.gsub!(/Ä/u,'Ä') # Ä + @html.gsub!(/Å/u,'Å') # Å + @html.gsub!(/Æ/u,'Æ') # Æ + @html.gsub!(/Ç/u,'Ç') # Ç + @html.gsub!(/È/u,'È') # È + @html.gsub!(/É/u,'É') # É + @html.gsub!(/Ê/u,'Ê') # Ê + @html.gsub!(/Ë/u,'Ë') # Ë + @html.gsub!(/Ì/u,'Ì') # Ì + @html.gsub!(/Í/u,'Í') # Í + @html.gsub!(/Î/u,'Î') # Î + @html.gsub!(/Ï/u,'Ï') # Ï + @html.gsub!(/Ð/u,'Ð') # Ð + @html.gsub!(/Ñ/u,'Ñ') # Ñ + @html.gsub!(/Ò/u,'Ò') # Ò + @html.gsub!(/Ó/u,'Ó') # Ó + @html.gsub!(/Ô/u,'Ô') # Ô + @html.gsub!(/Õ/u,'Õ') # Õ + @html.gsub!(/Ö/u,'Ö') # Ö + @html.gsub!(/Ø/u,'Ø') # Ø + @html.gsub!(/Ù/u,'Ù') # Ù + @html.gsub!(/Ú/u,'Ú') # Ú + @html.gsub!(/Û/u,'Û') # Û + @html.gsub!(/Ü/u,'Ü') # Ü + @html.gsub!(/Ý/u,'Ý') # Ý + @html.gsub!(/Þ/u,'Þ') # Þ + @html.gsub!(/ß/u,'ß') # ß + @html.gsub!(/à/u,'à') # à + @html.gsub!(/á/u,'á') # á + @html.gsub!(/â/u,'â') # â + @html.gsub!(/ã/u,'ã') # ã + @html.gsub!(/ä/u,'ä') # ä + @html.gsub!(/å/u,'å') # å + @html.gsub!(/æ/u,'æ') # æ + @html.gsub!(/ç/u,'ç') # ç + @html.gsub!(/è/u,'è') # è + @html.gsub!(/é/u,'é') # é + @html.gsub!(/ê/u,'ê') # ê + @html.gsub!(/ë/u,'ë') # ë + @html.gsub!(/ì/u,'ì') # ì + @html.gsub!(/í/u,'í') # í + @html.gsub!(/î/u,'î') # î + @html.gsub!(/ï/u,'ï') # ï + @html.gsub!(/ð/u,'ð') # ð + @html.gsub!(/ñ/u,'ñ') # ñ + @html.gsub!(/ò/u,'ò') # ò + @html.gsub!(/ó/u,'ó') # ó + @html.gsub!(/ô/u,'ô') # ô + @html.gsub!(/õ/u,'õ') # õ + @html.gsub!(/ö/u,'ö') # ö + @html.gsub!(/ø/u,'ø') # ø + @html.gsub!(/ù/u,'ù') # ú + @html.gsub!(/ú/u,'ú') # û + @html.gsub!(/û/u,'û') # ü + @html.gsub!(/ü/u,'ü') # ý + @html.gsub!(/þ/u,'þ') # þ + @html.gsub!(/ÿ/u,'ÿ') # ÿ + @html.gsub!(/ý/u,'ý') @html end end diff --git a/lib/sisu/v0/manpage.rb b/lib/sisu/v0/manpage.rb index c00d74b8..0657b0b6 100644 --- a/lib/sisu/v0/manpage.rb +++ b/lib/sisu/v0/manpage.rb @@ -311,7 +311,7 @@ WOK table_message='[table omitted, see other document formats]' fix=[] data.each do |para| - para.gsub!(//,'') # remove dummy headings (used by html) #check para.gsub!(/_\*\s+/,'* ') # bullet markup, marked down para.gsub!(/(.+?)<\/sup>/,'^\1^') @@ -449,7 +449,7 @@ WOK #formatMono=MonoSiSU.new('
Owner Details') #@@manpage[:owner_details]=formatMono.bold_para #para='' - elsif para =~/(¡|(.*)/ one,two=$1,$2 format_text=Format_text_object.new(one,two) diff --git a/lib/sisu/v0/odf.rb b/lib/sisu/v0/odf.rb index 874f87e1..f168ddc4 100644 --- a/lib/sisu/v0/odf.rb +++ b/lib/sisu/v0/odf.rb @@ -440,7 +440,7 @@ module SiSU_ODF elsif para =~ /<:code(?:-end)?>/ @@odf[:body] << code(para) @@odf[:body] << @br*2 - elsif para =~ /<\-_&!@%~#\]\[*=$| \n+`¡]/ + safe_characters=/[^a-zA-Z0-9}{\/?,."';:)(><\-_&!@%~#\]\[*=$| \n+`¡]/u dir=SiSU_Env::Info_env.new(@md.fns) @data_mod,@endnotes,@level,@cont,@copen,@odf_contents_close=Array.new(6){[]} @rcdc=false @@ -508,10 +508,10 @@ module SiSU_ODF para.gsub!(/(.+?)<\/sup>/,'\1') para.gsub!(/(.+?)<\/sub>/,'\1') para.gsub!(/`/,"'") - para.gsub!(/­/,'-') - para.gsub!(/·/,'*') - para.gsub!(/[“”]/,'""') - para.gsub!(/[­–—]/,'-') #— – chk + para.gsub!(/­/u,'-') + para.gsub!(/·/u,'*') + para.gsub!(/[“”]/u,'""') + para.gsub!(/[­–—]/u,'-') #— – chk para.gsub!(/ < /i,'<') para.gsub!(/\\copy(?:right)?\b/,'©') para.gsub!(/\\trademark\b|\\tm\b/,'®') diff --git a/lib/sisu/v0/odf_format.rb b/lib/sisu/v0/odf_format.rb index 05d1aefa..f704ea45 100644 --- a/lib/sisu/v0/odf_format.rb +++ b/lib/sisu/v0/odf_format.rb @@ -181,10 +181,10 @@ module OD_format m=@parablock[//,1] @@tablefoot << m if m @parablock.gsub!(//,'') - @@tablehead=1 if @parablock =~//; @parablock=table_head(@@table_counter,$1,true) - elsif @parablock =~//; @parablock=table_head(@@table_counter,$1) + @@tablehead=1 if @parablock =~//u; @parablock=table_head(@@table_counter,$1,true) + elsif @parablock =~//u; @parablock=table_head(@@table_counter,$1) end if @parablock =~// tablefoot=[] @@ -194,12 +194,12 @@ module OD_format end end if @@tablehead == 1 - if @parablock =~/¡¡/ - if @parablock =~// @parablock.gsub!(/!>/,table_row_close(true)) @@ -208,11 +208,11 @@ module OD_format end @parablock else - if @parablock =~// @parablock.gsub!(/!>/,table_row_close) diff --git a/lib/sisu/v0/plaintext.rb b/lib/sisu/v0/plaintext.rb index 62499e57..5beac25e 100644 --- a/lib/sisu/v0/plaintext.rb +++ b/lib/sisu/v0/plaintext.rb @@ -321,7 +321,7 @@ WOK table_message='[table omitted, see other document formats]' fix=[] data.each do |para| - para.gsub!(//,'') # remove dummy headings (used by html) #check para.gsub!(/_\*\s+/,'* ') # bullet markup, marked down para.gsub!(/(.+?)<\/sup>/,'^\1^') @@ -436,7 +436,7 @@ WOK #formatMono=MonoSiSU.new('
Owner Details') #@plaintext[:owner_details]=formatMono.bold_para #para='' - elsif para =~/(¡|(.*)/ one,two=$1,$2 format_text=Format_text_object.new(one,two) diff --git a/lib/sisu/v0/shared_html_lite.rb b/lib/sisu/v0/shared_html_lite.rb index da41dbb0..9f646790 100644 --- a/lib/sisu/v0/shared_html_lite.rb +++ b/lib/sisu/v0/shared_html_lite.rb @@ -194,7 +194,7 @@ GSUB m=parablock[//,1] @@tablefoot</,'') - @@tablehead=1 if parablock =~//, #%{\n") @@ -114,11 +114,11 @@ module SiSU_Tables end @parablock else - @parablock.gsub!(/

\n} + %{}) @@ -207,12 +207,12 @@ GSUB #%{#{tablefoot}}) end if @@tablehead == 1 - if parablock =~/¡¡/ - parablock.gsub!(/} + %{\n') @@ -220,11 +220,11 @@ GSUB end parablock else - parablock.gsub!(/} + %{\n') diff --git a/lib/sisu/v0/shared_xml.rb b/lib/sisu/v0/shared_xml.rb index 45dec06d..fd27c664 100644 --- a/lib/sisu/v0/shared_xml.rb +++ b/lib/sisu/v0/shared_xml.rb @@ -166,178 +166,178 @@ module SiSU_XML_munge #¢£¥§©ª«®°±²³µ¶¹º»¼½¾×÷ ##para.gsub!(//, '&#;') ##para.gsub!(//, '&;') - para.gsub!(/¢/, '¢') # '¢' # ¢ - para.gsub!(/£/, '£') # '£' # £ - para.gsub!(/¥/, '¥') # '¥' # ¥ - para.gsub!(/§/, '§') # '§' # § - para.gsub!(/©/, '©') # '©' # © - para.gsub!(/ª/, 'ª') # 'ª' # ª - para.gsub!(/«/, '«') # '«' # « - para.gsub!(/®/, '®') # '®' # ® - para.gsub!(/°/, '°') # '°' # ° - para.gsub!(/±/, '±') # '±' # ± - para.gsub!(/²/, '²') # '²' # ² - para.gsub!(/³/, '³') # '³' # ³ - para.gsub!(/µ/, 'µ') # 'µ' # µ - para.gsub!(/¶/, '¶') # '¶' # ¶ - para.gsub!(/¹/, '¹') # '¹' # ¹ - para.gsub!(/º/, 'º') # 'º' # º - para.gsub!(/»/, '»') # '»' # » - para.gsub!(/¼/, '¼') # '¼' # ¼ - para.gsub!(/½/, '½') # '½' # ½ - para.gsub!(/¾/, '¾') # '¾' # ¾ - para.gsub!(/×/, '×') # '×' # × - para.gsub!(/÷/, '÷') # '÷' # ÷ - para.gsub!(/¿/, '¿') # '¿' # ¿ - para.gsub!(/À/, 'À') # 'À' # À - para.gsub!(/Á/, 'Á') # 'Á' # Á - para.gsub!(/Â/, 'Â') # 'Â' #  - para.gsub!(/Ã/, 'Ã') # 'Ã' # à - para.gsub!(/Ä/, 'Ä') # 'Ä' # Ä - para.gsub!(/Å/, 'Å') # 'Å' # Å - para.gsub!(/Æ/, 'Æ') # 'Æ' # Æ - para.gsub!(/Ç/, 'Ç') # 'Ç' # Ç - para.gsub!(/È/, 'È') # 'È' # È - para.gsub!(/É/, 'É') # 'É' # É - para.gsub!(/Ê/, 'Ê') # 'Ê' # Ê - para.gsub!(/Ë/, 'Ë') # 'Ë' # Ë - para.gsub!(/Ì/, 'Ì') # 'Ì' # Ì - para.gsub!(/Í/, 'Í') # 'Í' # Í - para.gsub!(/Î/, 'Î') # 'Î' # Î - para.gsub!(/Ï/, 'Ï') # 'Ï' # Ï - para.gsub!(/Ð/, 'Ð') # 'Ð' # Ð - para.gsub!(/Ñ/, 'Ñ') # 'Ñ' # Ñ - para.gsub!(/Ò/, 'Ò') # 'Ò' # Ò - para.gsub!(/Ó/, 'Ó') # 'Ó' # Ó - para.gsub!(/Ô/, 'Ô') # 'Ô' # Ô - para.gsub!(/Õ/, 'Õ') # 'Õ' # Õ - para.gsub!(/Ö/, 'Ö') # 'Ö' # Ö - para.gsub!(/Ø/, 'Ø') # 'Ø' # Ø - para.gsub!(/Ù/, 'Ù') # 'Ù' # Ù - para.gsub!(/Ú/, 'Ú') # 'Ú' # Ú - para.gsub!(/Û/, 'Û') # 'Û' # Û - para.gsub!(/Ü/, 'Ü') # 'Ü' # Ü - para.gsub!(/Ý/, 'Ý') # 'Ý' # Ý - para.gsub!(/Þ/, 'Þ') # 'Þ' # Þ - para.gsub!(/ß/, 'ß') # 'ß' # ß - para.gsub!(/à/, 'à') # 'à' # à - para.gsub!(/á/, 'á') # 'á' # á - para.gsub!(/â/, 'â') # 'â' # â - para.gsub!(/ã/, 'ã') # 'ã' # ã - para.gsub!(/ä/, 'ä') # 'ä' # ä - para.gsub!(/å/, 'å') # 'å' # å - para.gsub!(/æ/, 'æ') # 'æ' # æ - para.gsub!(/ç/, 'ç') # 'ç' # ç - para.gsub!(/è/, 'è') # 'è' # è - para.gsub!(/é/, 'é') # '´' # é - para.gsub!(/ê/, 'ê') # 'ˆ' # ê - para.gsub!(/ë/, 'ë') # 'ë' # ë - para.gsub!(/ì/, 'ì') # 'ì' # ì - para.gsub!(/í/, 'í') # '´' # í - para.gsub!(/î/, 'î') # 'î' # î - para.gsub!(/ï/, 'ï') # 'ï' # ï - para.gsub!(/ð/, 'ð') # 'ð' # ð - para.gsub!(/ñ/, 'ñ') # 'ñ' # ñ - para.gsub!(/ò/, 'ò') # 'ò' # ò - para.gsub!(/ó/, 'ó') # 'ó' # ó - para.gsub!(/ô/, 'ô') # 'ô' # ô - para.gsub!(/õ/, 'õ') # 'õ' # õ - para.gsub!(/ö/, 'ö') # 'ö' # ö - para.gsub!(/ø/, 'ø') # 'ø' # ø - para.gsub!(/ù/, 'ú') # 'ù' # ú - para.gsub!(/ú/, 'û') # 'ú' # û - para.gsub!(/û/, 'ü') # 'û' # ü - para.gsub!(/ü/, 'ý') # 'ü' # ý - para.gsub!(/þ/, 'þ') # 'þ' # þ - para.gsub!(/ÿ/, 'ÿ') # 'ÿ' # ÿ + para.gsub!(/¢/u, '¢') # '¢' # ¢ + para.gsub!(/£/u, '£') # '£' # £ + para.gsub!(/¥/u, '¥') # '¥' # ¥ + para.gsub!(/§/u, '§') # '§' # § + para.gsub!(/©/u, '©') # '©' # © + para.gsub!(/ª/u, 'ª') # 'ª' # ª + para.gsub!(/«/u, '«') # '«' # « + para.gsub!(/®/u, '®') # '®' # ® + para.gsub!(/°/u, '°') # '°' # ° + para.gsub!(/±/u, '±') # '±' # ± + para.gsub!(/²/u, '²') # '²' # ² + para.gsub!(/³/u, '³') # '³' # ³ + para.gsub!(/µ/u, 'µ') # 'µ' # µ + para.gsub!(/¶/u, '¶') # '¶' # ¶ + para.gsub!(/¹/u, '¹') # '¹' # ¹ + para.gsub!(/º/u, 'º') # 'º' # º + para.gsub!(/»/u, '»') # '»' # » + para.gsub!(/¼/u, '¼') # '¼' # ¼ + para.gsub!(/½/u, '½') # '½' # ½ + para.gsub!(/¾/u, '¾') # '¾' # ¾ + para.gsub!(/×/u, '×') # '×' # × + para.gsub!(/÷/u, '÷') # '÷' # ÷ + para.gsub!(/¿/u, '¿') # '¿' # ¿ + para.gsub!(/À/u, 'À') # 'À' # À + para.gsub!(/Á/u, 'Á') # 'Á' # Á + para.gsub!(/Â/u, 'Â') # 'Â' #  + para.gsub!(/Ã/u, 'Ã') # 'Ã' # à + para.gsub!(/Ä/u, 'Ä') # 'Ä' # Ä + para.gsub!(/Å/u, 'Å') # 'Å' # Å + para.gsub!(/Æ/u, 'Æ') # 'Æ' # Æ + para.gsub!(/Ç/u, 'Ç') # 'Ç' # Ç + para.gsub!(/È/u, 'È') # 'È' # È + para.gsub!(/É/u, 'É') # 'É' # É + para.gsub!(/Ê/u, 'Ê') # 'Ê' # Ê + para.gsub!(/Ë/u, 'Ë') # 'Ë' # Ë + para.gsub!(/Ì/u, 'Ì') # 'Ì' # Ì + para.gsub!(/Í/u, 'Í') # 'Í' # Í + para.gsub!(/Î/u, 'Î') # 'Î' # Î + para.gsub!(/Ï/u, 'Ï') # 'Ï' # Ï + para.gsub!(/Ð/u, 'Ð') # 'Ð' # Ð + para.gsub!(/Ñ/u, 'Ñ') # 'Ñ' # Ñ + para.gsub!(/Ò/u, 'Ò') # 'Ò' # Ò + para.gsub!(/Ó/u, 'Ó') # 'Ó' # Ó + para.gsub!(/Ô/u, 'Ô') # 'Ô' # Ô + para.gsub!(/Õ/u, 'Õ') # 'Õ' # Õ + para.gsub!(/Ö/u, 'Ö') # 'Ö' # Ö + para.gsub!(/Ø/u, 'Ø') # 'Ø' # Ø + para.gsub!(/Ù/u, 'Ù') # 'Ù' # Ù + para.gsub!(/Ú/u, 'Ú') # 'Ú' # Ú + para.gsub!(/Û/u, 'Û') # 'Û' # Û + para.gsub!(/Ü/u, 'Ü') # 'Ü' # Ü + para.gsub!(/Ý/u, 'Ý') # 'Ý' # Ý + para.gsub!(/Þ/u, 'Þ') # 'Þ' # Þ + para.gsub!(/ß/u, 'ß') # 'ß' # ß + para.gsub!(/à/u, 'à') # 'à' # à + para.gsub!(/á/u, 'á') # 'á' # á + para.gsub!(/â/u, 'â') # 'â' # â + para.gsub!(/ã/u, 'ã') # 'ã' # ã + para.gsub!(/ä/u, 'ä') # 'ä' # ä + para.gsub!(/å/u, 'å') # 'å' # å + para.gsub!(/æ/u, 'æ') # 'æ' # æ + para.gsub!(/ç/u, 'ç') # 'ç' # ç + para.gsub!(/è/u, 'è') # 'è' # è + para.gsub!(/é/u, 'é') # '´' # é + para.gsub!(/ê/u, 'ê') # 'ˆ' # ê + para.gsub!(/ë/u, 'ë') # 'ë' # ë + para.gsub!(/ì/u, 'ì') # 'ì' # ì + para.gsub!(/í/u, 'í') # '´' # í + para.gsub!(/î/u, 'î') # 'î' # î + para.gsub!(/ï/u, 'ï') # 'ï' # ï + para.gsub!(/ð/u, 'ð') # 'ð' # ð + para.gsub!(/ñ/u, 'ñ') # 'ñ' # ñ + para.gsub!(/ò/u, 'ò') # 'ò' # ò + para.gsub!(/ó/u, 'ó') # 'ó' # ó + para.gsub!(/ô/u, 'ô') # 'ô' # ô + para.gsub!(/õ/u, 'õ') # 'õ' # õ + para.gsub!(/ö/u, 'ö') # 'ö' # ö + para.gsub!(/ø/u, 'ø') # 'ø' # ø + para.gsub!(/ù/u, 'ú') # 'ù' # ú + para.gsub!(/ú/u, 'û') # 'ú' # û + para.gsub!(/û/u, 'ü') # 'û' # ü + para.gsub!(/ü/u, 'ý') # 'ü' # ý + para.gsub!(/þ/u, 'þ') # 'þ' # þ + para.gsub!(/ÿ/u, 'ÿ') # 'ÿ' # ÿ end end def html(para='') if @sys.locale =~/utf-?8/i # instead ucs for utf8 #require 'iconv' ? Iñtërnâtiônàlizætiøn - para.gsub!(/¢/, '¢') # ¢ - para.gsub!(/£/, '£') # £ - para.gsub!(/¥/, '¥') # ¥ - para.gsub!(/§/, '§') # § - para.gsub!(/©/, '©') # © - para.gsub!(/ª/, 'ª') # ª - para.gsub!(/«/, '«') # « - para.gsub!(/®/, '®') # ® - para.gsub!(/°/, '°') # ° - para.gsub!(/±/, '±') # ± - para.gsub!(/²/, '²') # ² - para.gsub!(/³/, '³') # ³ - para.gsub!(/µ/, 'µ') # µ - para.gsub!(/¶/, '¶') # ¶ - para.gsub!(/¹/, '¹') # ¹ - para.gsub!(/º/, 'º') # º - para.gsub!(/»/, '»') # » - para.gsub!(/¼/, '¼') # ¼ - para.gsub!(/½/, '½') # ½ - para.gsub!(/¾/, '¾') # ¾ - para.gsub!(/×/, '×') # × - para.gsub!(/÷/, '÷') # ÷ - para.gsub!(/¿/, '¿') # ¿ - para.gsub!(/À/, 'À') # À - para.gsub!(/Á/, 'Á') # Á - para.gsub!(/Â/, 'Â') #  - para.gsub!(/Ã/, 'Ã') # à - para.gsub!(/Ä/, 'Ä') # Ä - para.gsub!(/Å/, 'Å') # Å - para.gsub!(/Æ/, 'Æ') # Æ - para.gsub!(/Ç/, 'Ç') # Ç - para.gsub!(/È/, 'È') # È - para.gsub!(/É/, 'É') # É - para.gsub!(/Ê/, 'Ê') # Ê - para.gsub!(/Ë/, 'Ë') # Ë - para.gsub!(/Ì/, 'Ì') # Ì - para.gsub!(/Í/, 'Í') # Í - para.gsub!(/Î/, 'Î') # Î - para.gsub!(/Ï/, 'Ï') # Ï - para.gsub!(/Ð/, 'Ð') # Ð - para.gsub!(/Ñ/, 'Ñ') # Ñ - para.gsub!(/Ò/, 'Ò') # Ò - para.gsub!(/Ó/, 'Ó') # Ó - para.gsub!(/Ô/, 'Ô') # Ô - para.gsub!(/Õ/, 'Õ') # Õ - para.gsub!(/Ö/, 'Ö') # Ö - para.gsub!(/Ø/, 'Ø') # Ø - para.gsub!(/Ù/, 'Ù') # Ù - para.gsub!(/Ú/, 'Ú') # Ú - para.gsub!(/Û/, 'Û') # Û - para.gsub!(/Ü/, 'Ü') # Ü - para.gsub!(/Ý/, 'Ý') # Ý - para.gsub!(/Þ/, 'Þ') # Þ - para.gsub!(/ß/, 'ß') # ß - para.gsub!(/à/, 'à') # à - para.gsub!(/á/, 'á') # á - para.gsub!(/â/, 'â') # â - para.gsub!(/ã/, 'ã') # ã - para.gsub!(/ä/, 'ä') # ä - para.gsub!(/å/, 'å') # å - para.gsub!(/æ/, 'æ') # æ - para.gsub!(/ç/, 'ç') # ç - para.gsub!(/è/, 'è') # è - para.gsub!(/é/, '´') # é - para.gsub!(/ê/, 'ˆ') # ê - para.gsub!(/ë/, 'ë') # ë - para.gsub!(/ì/, 'ì') # ì - para.gsub!(/í/, '´') # í - para.gsub!(/î/, 'î') # î - para.gsub!(/ï/, 'ï') # ï - para.gsub!(/ð/, 'ð') # ð - para.gsub!(/ñ/, 'ñ') # ñ - para.gsub!(/ò/, 'ò') # ò - para.gsub!(/ó/, 'ó') # ó - para.gsub!(/ô/, 'ô') # ô - para.gsub!(/õ/, 'õ') # õ - para.gsub!(/ö/, 'ö') # ö - para.gsub!(/ø/, 'ø') # ø - para.gsub!(/ù/, 'ù') # ú - para.gsub!(/ú/, 'ú') # û - para.gsub!(/û/, 'û') # ü - para.gsub!(/ü/, 'ü') # ý - para.gsub!(/þ/, 'þ') # þ - para.gsub!(/ÿ/, 'ÿ') # ÿ + para.gsub!(/¢/u, '¢') # ¢ + para.gsub!(/£/u, '£') # £ + para.gsub!(/¥/u, '¥') # ¥ + para.gsub!(/§/u, '§') # § + para.gsub!(/©/u, '©') # © + para.gsub!(/ª/u, 'ª') # ª + para.gsub!(/«/u, '«') # « + para.gsub!(/®/u, '®') # ® + para.gsub!(/°/u, '°') # ° + para.gsub!(/±/u, '±') # ± + para.gsub!(/²/u, '²') # ² + para.gsub!(/³/u, '³') # ³ + para.gsub!(/µ/u, 'µ') # µ + para.gsub!(/¶/u, '¶') # ¶ + para.gsub!(/¹/u, '¹') # ¹ + para.gsub!(/º/u, 'º') # º + para.gsub!(/»/u, '»') # » + para.gsub!(/¼/u, '¼') # ¼ + para.gsub!(/½/u, '½') # ½ + para.gsub!(/¾/u, '¾') # ¾ + para.gsub!(/×/u, '×') # × + para.gsub!(/÷/u, '÷') # ÷ + para.gsub!(/¿/u, '¿') # ¿ + para.gsub!(/À/u, 'À') # À + para.gsub!(/Á/u, 'Á') # Á + para.gsub!(/Â/u, 'Â') #  + para.gsub!(/Ã/u, 'Ã') # à + para.gsub!(/Ä/u, 'Ä') # Ä + para.gsub!(/Å/u, 'Å') # Å + para.gsub!(/Æ/u, 'Æ') # Æ + para.gsub!(/Ç/u, 'Ç') # Ç + para.gsub!(/È/u, 'È') # È + para.gsub!(/É/u, 'É') # É + para.gsub!(/Ê/u, 'Ê') # Ê + para.gsub!(/Ë/u, 'Ë') # Ë + para.gsub!(/Ì/u, 'Ì') # Ì + para.gsub!(/Í/u, 'Í') # Í + para.gsub!(/Î/u, 'Î') # Î + para.gsub!(/Ï/u, 'Ï') # Ï + para.gsub!(/Ð/u, 'Ð') # Ð + para.gsub!(/Ñ/u, 'Ñ') # Ñ + para.gsub!(/Ò/u, 'Ò') # Ò + para.gsub!(/Ó/u, 'Ó') # Ó + para.gsub!(/Ô/u, 'Ô') # Ô + para.gsub!(/Õ/u, 'Õ') # Õ + para.gsub!(/Ö/u, 'Ö') # Ö + para.gsub!(/Ø/u, 'Ø') # Ø + para.gsub!(/Ù/u, 'Ù') # Ù + para.gsub!(/Ú/u, 'Ú') # Ú + para.gsub!(/Û/u, 'Û') # Û + para.gsub!(/Ü/u, 'Ü') # Ü + para.gsub!(/Ý/u, 'Ý') # Ý + para.gsub!(/Þ/u, 'Þ') # Þ + para.gsub!(/ß/u, 'ß') # ß + para.gsub!(/à/u, 'à') # à + para.gsub!(/á/u, 'á') # á + para.gsub!(/â/u, 'â') # â + para.gsub!(/ã/u, 'ã') # ã + para.gsub!(/ä/u, 'ä') # ä + para.gsub!(/å/u, 'å') # å + para.gsub!(/æ/u, 'æ') # æ + para.gsub!(/ç/u, 'ç') # ç + para.gsub!(/è/u, 'è') # è + para.gsub!(/é/u, '´') # é + para.gsub!(/ê/u, 'ˆ') # ê + para.gsub!(/ë/u, 'ë') # ë + para.gsub!(/ì/u, 'ì') # ì + para.gsub!(/í/u, '´') # í + para.gsub!(/î/u, 'î') # î + para.gsub!(/ï/u, 'ï') # ï + para.gsub!(/ð/u, 'ð') # ð + para.gsub!(/ñ/u, 'ñ') # ñ + para.gsub!(/ò/u, 'ò') # ò + para.gsub!(/ó/u, 'ó') # ó + para.gsub!(/ô/u, 'ô') # ô + para.gsub!(/õ/u, 'õ') # õ + para.gsub!(/ö/u, 'ö') # ö + para.gsub!(/ø/u, 'ø') # ø + para.gsub!(/ù/u, 'ù') # ú + para.gsub!(/ú/u, 'ú') # û + para.gsub!(/û/u, 'û') # ü + para.gsub!(/ü/u, 'ü') # ý + para.gsub!(/þ/u, 'þ') # þ + para.gsub!(/ÿ/u, 'ÿ') # ÿ end end self diff --git a/lib/sisu/v0/sysenv.rb b/lib/sisu/v0/sysenv.rb index 28dc088b..fb3daefe 100644 --- a/lib/sisu/v0/sysenv.rb +++ b/lib/sisu/v0/sysenv.rb @@ -1201,9 +1201,16 @@ WOK "#{source_file_path}/#{file}" end def read_source_file(fns) - fns_array=unless fns =~/\.ssm.sst$/ - IO.readlines(fns,'') - else IO.readlines("#{path.composite_file}/#{fns}",'') + fns_array=if RUBY_VERSION < '1.9' + x=unless fns =~/\.ssm.sst$/ + IO.readlines(fns,'') + else IO.readlines("#{path.composite_file}/#{fns}",'') + end + else #ruby version >= '1.9' + x=unless fns =~/\.ssm.sst$/ + IO.readlines(fns,'r:utf-8') + else IO.readlines("#{path.composite_file}/#{fns}",'r:utf-8') + end end end def path #dir @@ -3124,3 +3131,15 @@ module SiSU_Errors end __END__ https? intro check 2007-09-22 + +fns_array=unless fns =~/\.ssm.sst$/ + if RUBY_VERSION < '1.9' + IO.readlines(fns,'') + else IO.readlines(fns,'r:utf-8') + end +else + if RUBY_VERSION < '1.9' + IO.readlines("#{path.composite_file}/#{fns}",'') + else IO.readlines("#{path.composite_file}/#{fns}",'r:utf-8') + end +end diff --git a/lib/sisu/v0/texinfo.rb b/lib/sisu/v0/texinfo.rb index f96a3339..b6133ed7 100644 --- a/lib/sisu/v0/texinfo.rb +++ b/lib/sisu/v0/texinfo.rb @@ -159,7 +159,7 @@ module SiSU_TexInfo data.each do |para| # DEBUG 2003w16 this is a kludge, because i could not get parameters # from param, Sort out ... revert to more elegant solution - if para =~ //,'') @@ -242,7 +242,7 @@ module SiSU_TexInfo @tex_file=[] @@tableheader=0 data.each do |para| - if para =~ /¡|/i] + if @para[//ui] no_of_cols,cols_width=$1,$2 @@tableheader=1 if @para =~ //,"#{@@start_table}") + @para.gsub!(//u,"#{@@start_table}") end if @para =~// @para.gsub!(//," #@end_table") end - @para.gsub!(//,1] @para.gsub!(/\/,'') - @para.gsub!(/¡\d+?¡(.+?)(?:¡|!)/, + @para.gsub!(/¡\d+?¡(.+?)(?:¡|!)/u, "{\\begin{tiny} {\\bfseries \\1}\\end{tiny}}&") @para.gsub!(/&>\s*$/, " #@row_break \\hline\\endhead #@row_break") @@ -408,8 +408,8 @@ WOK @@number_of_cols=0 end else - if @para =~/¡\d+?¡(.+?)(?:¡|!)/ - @para.gsub!(/¡\d+?¡(.+?)(?:¡|!)/,"\\begin{tiny}\\1\\end{tiny}&") + if @para =~/¡\d+?¡(.+?)(?:¡|!)/u + @para.gsub!(/¡\d+?¡(.+?)(?:¡|!)/u,"\\begin{tiny}\\1\\end{tiny}&") @para.gsub!(/&>\s*$/," #@row_break") end end @@ -422,7 +422,7 @@ WOK @end_table="\\end{tabular}" @row_break='\\\\\\\\' @break_page="#@row_break\n#@row_break \n" - if @para[//i] + if @para[//ui] no_of_cols,cols_width=$1,$2 @w=cols_width.split(/;\s+/) @colW=[] @@ -431,13 +431,13 @@ WOK @colW << "p{#{col_w}cm}" if col_w end @@start_table="\\begin{tabular}{#@colW}\n" - @para.gsub!(//,"#{@@start_table}") + @para.gsub!(//u,"#{@@start_table}") end if @para =~// @para.gsub!(//,"#@end_table") @@table_pg_break_counter=1 end - if @para =~//] @para.gsub!(/\/,'') end end - if @para =~/¡\d+?¡(.+?)(?:¡|!)/ - @para.gsub!(/¡\d+?¡(.+?)(?:¡|!)/,"\\begin{tiny}\\1\\end{tiny}&") + if @para =~/¡\d+?¡(.+?)(?:¡|!)/u + @para.gsub!(/¡\d+?¡(.+?)(?:¡|!)/u,"\\begin{tiny}\\1\\end{tiny}&") @para.gsub!(/&>\s*$/,"#@row_break") end @para diff --git a/lib/sisu/v0/texpdf.rb b/lib/sisu/v0/texpdf.rb index d19384cf..f11e456d 100644 --- a/lib/sisu/v0/texpdf.rb +++ b/lib/sisu/v0/texpdf.rb @@ -302,12 +302,12 @@ module SiSU_TeX else para end if para.class == String - @md.flag_tables=true if para =~/ 0, :l => 0 } @tex_file=[] data.each do |para| - @tex_file << if para =~/¡|/] + if @string[//u] no_of_cols,cols_width,ocn=$1,$2,$3 tw=case @md.papersize when /a4/i; @tx.a4.landscape.w #European default, SiSU default @@ -313,24 +313,24 @@ WOK @colW=@colW.join @start_table="<~#{ocn}>\n\\setlength{\\LTleft}{0pt}\n\\setlength{\\LTright}{\\fill}\n" + "\\begin{tiny}\n\\begin{longtable}#@colW\n" - @string.gsub!(//,@start_table) + @string.gsub!(//u,@start_table) end if @string =~// @string.gsub!(//," #@end_table\n\\end{tiny}") end - @string.gsub!(//,1] @string.gsub!(/\/,'') - @string.gsub!(/¡\d+?¡(.+?)(?:¡|!)/,'\bfseries \1&') + @string.gsub!(/¡\d+?¡(.+?)(?:¡|!)/u,'\bfseries \1&') @string.gsub!(/&>\s*$/," #@row_break \\hline\\endhead #@row_break") @string="#@string \\multicolumn{#{@@number_of_cols}}{l}{\\tiny #{tablefoot}} \\\\ \\hline\n\\endfoot\n\\hline\n" if tablefoot @@tableheader[:l],@@number_of_cols=0,0 end else - if @string =~/¡\d+?¡(.+?)(?:¡|!)/ - @string.gsub!(/¡\d+?¡(.+?)(?:¡|!)/,'\1&') + if @string =~/¡\d+?¡(.+?)(?:¡|!)/u + @string.gsub!(/¡\d+?¡(.+?)(?:¡|!)/u,'\1&') @string.gsub!(/&>\s*$/," #@row_break") end end @@ -341,7 +341,7 @@ WOK def longtable_portrait @end_table='\end{longtable}' @row_break='\\\\\\' - if @string[//] + if @string[//u] no_of_cols,cols_width,ocn=$1,$2,$3 tw=case @md.papersize when /a4/i; @tx.a4.portrait.w #European default, SiSU default @@ -368,24 +368,24 @@ WOK @colW=@colW.join @start_table="<~#{ocn}>\n\\setlength{\\LTleft}{0pt}\n\\setlength{\\LTright}{\\fill}\n" + "\\begin{tiny}\n\\begin{longtable}#@colW\n" - @string.gsub!(//,"#@start_table") + @string.gsub!(//u,"#@start_table") end if @string =~// @string.gsub!(//," #@end_table\n\\end{tiny}") end - @string.gsub!(//,1] @string.gsub!(/\/,'') - @string.gsub!(/¡\d+?¡(.+?)(?:¡|!)/,'\bfseries \1&') + @string.gsub!(/¡\d+?¡(.+?)(?:¡|!)/u,'\bfseries \1&') @string.gsub!(/&>\s*$/," #@row_break \\hline\\endhead #@row_break") @string="#@string \\multicolumn{#{@@number_of_cols}}{l}{\\tiny #{tablefoot}} \\\\ \\hline\n\\endfoot\n\\hline\n" if tablefoot @@tableheader[:p],@@number_of_cols=0,0 end else - if @string =~/¡\d+?¡(.+?)(?:¡|!)/ - @string.gsub!(/¡\d+?¡(.+?)(?:¡|!)/,'\1&') + if @string =~/¡\d+?¡(.+?)(?:¡|!)/u + @string.gsub!(/¡\d+?¡(.+?)(?:¡|!)/u,'\1&') @string.gsub!(/&>\s*$/," #@row_break") end end @@ -399,7 +399,7 @@ WOK @end_table="\\end{tabular}" @row_break='\\\\\\\\' @break_page="#@row_break\n#@row_break \n" - if @string[//] + if @string[//u] no_of_cols,cols_width=$1,$2 @w=cols_width.split(/;\s*/) @colW=[] @@ -408,25 +408,25 @@ WOK @colW << "p{#{col_w}cm}" if col_w end @start_table="\\begin{tabular}{#@colW}\n" - @string.gsub!(//,"#@start_table}") + @string.gsub!(//u,"#@start_table}") end if @string =~// @string.gsub!(//,"#@end_table") @@table_pg_break_counter=1 end - if @string =~//,1] @string.gsub!(/\/,'') end end - if @string =~/¡\d+?¡(.+?)(?:¡|!)/ - @string.gsub!(/¡\d+?¡(.+?)(?:¡|!)/,"\\1&") + if @string =~/¡\d+?¡(.+?)(?:¡|!)/u + @string.gsub!(/¡\d+?¡(.+?)(?:¡|!)/u,"\\1&") @string.gsub!(/&>\s*$/,"#@row_break") end @string @@ -438,7 +438,7 @@ WOK para_array=[] if word word.each do |w| # _ - / # | : ! ^ ~ - unless para =~/^(?:0~|%+ |') unless w=~/^[1-6]~|~\{|\}~|~\[|\]~|^\^~\s|~\^|\*~\S+|~#|\{t~|<~\d+;(?:[ohmu]|[0-6]:)\d+;\w\d+>/ w.gsub!(/&#(?:126|152);/,'<=tilde>') #126 usual #w.gsub!(/&#(?:126|152);/,'<=tilde>') unless w=~/https?:\/\/\S+/ #126 usual @@ -501,8 +501,8 @@ WOK if @@flag_code; @string.gsub!(/&/,'{\\\&}') else @string.gsub!(/(\s+&\s+)/,' and ') end - @string.gsub!(/§/,'\S') #latex: space between next character not preserved? #@string.gsub!(/§ /,'\S ') - @string.gsub!(/£/,'\pounds') + @string.gsub!(/§/u,'\S') #latex: space between next character not preserved? #@string.gsub!(/§ /,'\S ') + @string.gsub!(/£/u,'\pounds') @string.gsub!(/&\S+?;/,' ') @string.gsub!(//,' ') @string.gsub!(/<\/a>/,' ') diff --git a/lib/sisu/v0/wikispeak.rb b/lib/sisu/v0/wikispeak.rb index 0812e81a..ec74afce 100644 --- a/lib/sisu/v0/wikispeak.rb +++ b/lib/sisu/v0/wikispeak.rb @@ -242,7 +242,7 @@ WOK table_message='[table omitted, see other document formats]' fix=[] data.each do |para| - para.gsub!(//,'') # remove dummy headings (used by html) #check para.gsub!(/_\*\s+/,'* ') # bullet markup, marked down para.gsub!(/©/,'©') # bullet markup, marked down @@ -334,7 +334,7 @@ WOK #formatMono=MonoSiSU.new('
Owner Details') #@@wiki[:owner_details]=formatMono.bold_para #para='' - elsif para =~/(¡|(.*)/ one,two=$1,$2 format_text=Format_text_object.new(one,two) diff --git a/lib/sisu/v0/xml_tables.rb b/lib/sisu/v0/xml_tables.rb index bc045837..be8c1dd1 100644 --- a/lib/sisu/v0/xml_tables.rb +++ b/lib/sisu/v0/xml_tables.rb @@ -87,9 +87,9 @@ module SiSU_Tables m=@parablock[//,1] @@tablefoot << m if m @parablock.gsub!(//,'') - @@tablehead=1 if @parablock =~//, + @@tablehead=1 if @parablock =~//u, %{\n#@ocn
} + %{#{para_table}}) - parablock.gsub!(/¡¡(\d+?)¡/, + parablock.gsub!(/¡¡(\d+?)¡/u, %{} + %{#{para_table}}) parablock.gsub!(/!>/, '
} + %{#{para_table}}) - parablock.gsub!(/¡¡(\d+?)¡/, + parablock.gsub!(/¡¡(\d+?)¡/u, %{} + %{#{para_table}}) parablock.gsub!(/!>/, '
}) end if @parablock =~// @@ -101,12 +101,12 @@ module SiSU_Tables @parablock.gsub!(/\s*/,"
\n") end if @@tablehead == 1 - if @parablock =~/¡¡/ - @parablock.gsub!(/
#{@vz.paragraph_table_xml}}) - @parablock.gsub!(/¡¡(\d+?)¡/, + @parablock.gsub!(/¡¡(\d+?)¡/u, %{ #{@vz.paragraph_table_xml}}) @parablock.gsub!(/!>/,"\n
#{@vz.paragraph_table_xml}}) - @parablock.gsub!(/¡¡(\d+?)¡/, + @parablock.gsub!(/¡¡(\d+?)¡/u, %{ @@ -170,8 +170,8 @@ module SiSU_Tables m=@parablock[//,1] @@tablefoot << m if m @parablock.gsub!(//,'') - @@tablehead=1 if @parablock =~//; @parablock=table_head($1) + @@tablehead=1 if @parablock =~//u; @parablock=table_head($1) end if @parablock =~// tablefoot=[] @@ -181,12 +181,12 @@ module SiSU_Tables end end if @@tablehead == 1 - if @parablock =~/¡¡/ - if @parablock =~// @parablock.gsub!(/!>/,table_row_close(true)) @@ -195,11 +195,11 @@ module SiSU_Tables end @parablock else - if @parablock =~// @parablock.gsub!(/!>/,table_row_close) -- cgit v1.2.3