aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2008-02-05 23:50:34 +0000
committerRalph Amissah <ralph@amissah.com>2008-02-05 23:50:34 +0000
commitad21750ba3c44303d0c2ad91269771605612a8e6 (patch)
treefb1c5ce2737a1cf04069e409563e20540dcea9ff /lib
parentUpdated sisu-0.64.2 (diff)
parentversion rolled back, not ready to open ruby 1.9 some libraries not yet available (diff)
Merge branch 'upstream' into debian/sid
Diffstat (limited to 'lib')
-rw-r--r--lib/sisu/v0/dal.rb18
-rw-r--r--lib/sisu/v0/dal_doc_str.rb2
-rw-r--r--lib/sisu/v0/dal_doc_str_tables.rb24
-rw-r--r--lib/sisu/v0/db_import.rb8
-rw-r--r--lib/sisu/v0/db_remove.rb24
-rw-r--r--lib/sisu/v0/html_format.rb2
-rw-r--r--lib/sisu/v0/html_segments.rb4
-rw-r--r--lib/sisu/v0/html_table.rb22
-rw-r--r--lib/sisu/v0/html_tune.rb172
-rw-r--r--lib/sisu/v0/manpage.rb4
-rw-r--r--lib/sisu/v0/odf.rb12
-rw-r--r--lib/sisu/v0/odf_format.rb26
-rw-r--r--lib/sisu/v0/plaintext.rb4
-rw-r--r--lib/sisu/v0/shared_html_lite.rb12
-rw-r--r--lib/sisu/v0/shared_xml.rb336
-rw-r--r--lib/sisu/v0/sysenv.rb25
-rw-r--r--lib/sisu/v0/texinfo.rb4
-rw-r--r--lib/sisu/v0/texinfo_format.rb26
-rw-r--r--lib/sisu/v0/texpdf.rb6
-rw-r--r--lib/sisu/v0/texpdf_format.rb46
-rw-r--r--lib/sisu/v0/wikispeak.rb4
-rw-r--r--lib/sisu/v0/xml_tables.rb38
22 files changed, 424 insertions, 395 deletions
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!(/<br>/,'<br />') #needed by xml, xhtml etc.
#para.gsub!(/<p>/,'<p />') #consider
para.gsub!(/`/,"'")
- para.gsub!(/\342\200\231/,"'") #if para =~/’/ #Avoid #&lsquo; &rsquo; #&ldquo; &rdquo;
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 #&lsquo; &rsquo; #&ldquo; &rdquo;
+ para.gsub!(/�/u,' ') #watch, replace with char code
+ para.gsub!(/[“”]/u,'""')
+ para.gsub!(/[­–—]/u,'-') #— – chk
+ para.gsub!(/·/u,'*')
para.gsub!(/\\copy(?:right)?\b/,'&#169;')
para.gsub!(/\\trademark\b|\\tm\b/,'&#174;')
#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 =~/<!Th?¡/; para.gsub!(/(<!Th?¡.+?!)>/,"\\1~#{o[:ocn]};#{o[:lv]};#{o[:type]}>")
+ if para =~/<!Th?¡/u; para.gsub!(/(<!Th?¡.+?!)>/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; ]*\}/
- "<!Th¡ c#{@row[2].length}; #{widths}!>"
+ "<!Th#{TS1} c#{@row[2].length}; #{widths}!>"
elsif para =~/\{(?:t|table)(?:\sc\d+;)?[\d; ]*\}/
- "<!T¡ c#{@row[2].length}; #{widths}!>"
+ "<!T#{TS1} c#{@row[2].length}; #{widths}!>"
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 #'<td>' + c + '</td>'
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 << '!>' #'</tr>'
@@ -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+?;.+?)$/,'<!Th¡ \1!>')
- para.gsub!(/^table\{\s+(c\d+?;.+?)$/,'<!T¡ \1!>')
+ para.gsub!(/^table\{~h\s+(c\d+?;.+?)$/,"<!Th#{TS1} \\1!>")
+ para.gsub!(/^table\{\s+(c\d+?;.+?)$/,"<!T#{TS1} \\1!>")
@@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,'<!\1!>') unless para =~/<!Th?¡/
+ para.gsub!(/(.*\S+.*)\Z/m,'<!\1!>') unless para =~/<!Th?#{TS1}/u
end
para.gsub!(/\n/,' ')
para.strip!
@@ -182,7 +182,10 @@ module SiSU_document_structure_tables
data.each do |line|
if @@counter <= @@columns.to_i \
and line !~/(\}T\s*$|<:table[-_](close|end)>|<!TZ!>)/
- line.gsub!(/(.+)/,"¡¡#{@@column[@@counter]}¡\\1") unless line =~/<!Th?¡/
+ #if line.encoding.inspect =~/Encoding:ASCII-8BIT/
+ # line=line.force_encoding('utf-8')
+ #end
+ line.gsub!(/(.+)/,"#{TS1}#{TS1}#{@@column[@@counter]}#{TS1}\\1") unless line =~/<!Th?#{TS1}/u
@@counter+=1
end
end
@@ -191,3 +194,6 @@ module SiSU_document_structure_tables
end
end
__END__
+#p line.encoding
+@data.each {|x| p x.encoding }
+p para if para.encoding.inspect =~/Encoding:ASCII-8BIT/
diff --git a/lib/sisu/v0/db_import.rb b/lib/sisu/v0/db_import.rb
index 38cbb45d..0c53e5e5 100644
--- a/lib/sisu/v0/db_import.rb
+++ b/lib/sisu/v0/db_import.rb
@@ -133,10 +133,10 @@ module SiSU_DB_import
string.gsub!(/<sup>(\d+)<\/sup>/,'[\1]')
string.gsub!(/<:i[12]>/,'')
string.gsub!(/(?:&nbsp\\;)+/,' ')
- string.gsub!(/<!T[h]?¡.+?!>/,"[TABLE]\n") #tables
- string.gsub!(/<!¡¡\d+(.+?)!>/,'\1') #tables
- string.gsub!(/¡¡\d+¡/,' ') #tables
- string.gsub!(/¡/,' ') #tables tidy later
+ string.gsub!(/<!T[h]?¡.+?!>/u,"[TABLE]\n") #tables
+ string.gsub!(/<!¡¡\d+(.+?)!>/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/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")
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 !~/<!Th?¡ /m
+ #@parablock=if parablock=~/\S+/ and parablock !~/<!Th?¡ /um
# wrap=SiSU_text_utils::Wrap.new(parablock,70,4)
# wrap.line_wrap
#else parablock
diff --git a/lib/sisu/v0/html_segments.rb b/lib/sisu/v0/html_segments.rb
index 7972619a..687000f1 100644
--- a/lib/sisu/v0/html_segments.rb
+++ b/lib/sisu/v0/html_segments.rb
@@ -174,7 +174,7 @@ module SiSU_HTML_seg
end
m=para[/.+?<a name="(\d+)">.*/]; @@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 =~/<!Th?¡\s+c|<:(?:code|alt|verse|group)>/m; para.split(/\n/)
+ para=if para =~/<!Th?¡\s+c|<:(?:code|alt|verse|group)>/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 =~/¡|<!T[hZ]?/
+ elsif para =~/¡|<!T[hZ]?/u
table=SiSU_HTML_shared::Table.new(para)
para=table.table
end
diff --git a/lib/sisu/v0/html_table.rb b/lib/sisu/v0/html_table.rb
index 12d02407..1ac39daf 100644
--- a/lib/sisu/v0/html_table.rb
+++ b/lib/sisu/v0/html_table.rb
@@ -101,8 +101,8 @@ module SiSU_HTML_table
m=@parablock[/<!f(.+?)!>/,1]
@@tablefoot << m if m
@parablock.gsub!(/<!f.+?!>/,'')
- @@tablehead=1 if @parablock =~/<!Th¡/
- if @parablock =~/<!Th?¡.+?!~(\d+);\w\d+;\w\d+>/; @parablock=table_head($1)
+ @@tablehead=1 if @parablock =~/<!Th¡/u
+ if @parablock =~/<!Th?¡.+?!~(\d+);\w\d+;\w\d+>/u; @parablock=table_head($1)
end
if @parablock =~/<!TZ!>/
tablefoot=[]
@@ -112,12 +112,12 @@ module SiSU_HTML_table
end
end
if @@tablehead == 1
- if @parablock =~/¡¡/
- if @parablock =~/<!¡¡(\d+?)¡/
- @parablock.gsub!(/<!¡¡(\d+?)¡/,table_row($1,true))
+ if @parablock =~/¡¡/u
+ if @parablock =~/<!¡¡(\d+?)¡/u
+ @parablock.gsub!(/<!¡¡(\d+?)¡/u,table_row($1,true))
end
- if @parablock =~/¡¡(\d+?)¡/
- @parablock.gsub!(/¡¡(\d+?)¡/,table_cell($1,true))
+ if @parablock =~/¡¡(\d+?)¡/u
+ @parablock.gsub!(/¡¡(\d+?)¡/u,table_cell($1,true))
end
if @parablock =~/!>/
@parablock.gsub!(/!>/,table_row_close(true))
@@ -126,11 +126,11 @@ module SiSU_HTML_table
end
@parablock
else
- if @parablock =~/<!¡¡(\d+?)¡/
- @parablock.gsub!(/<!¡¡(\d+?)¡/,table_row($1))
+ if @parablock =~/<!¡¡(\d+?)¡/u
+ @parablock.gsub!(/<!¡¡(\d+?)¡/u,table_row($1))
end
- if @parablock =~/¡¡(\d+?)¡/
- @parablock.gsub!(/¡¡(\d+?)¡/,table_cell($1))
+ if @parablock =~/¡¡(\d+?)¡/u
+ @parablock.gsub!(/¡¡(\d+?)¡/u,table_cell($1))
end
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!(/¢/,'&cent;') # &#162;
- @html.gsub!(/£/,'&pound;') # &#163;
- @html.gsub!(/¥/,'&yen;') # &#165;
- @html.gsub!(/§/,'&sect;') # &#167;
- @html.gsub!(/©/,'&copy;') # &#169;
- @html.gsub!(/ª/,'&ordf;') # &#170;
- @html.gsub!(/«/,'&laquo;') # &#171;
- @html.gsub!(/®/,'&reg;') # &#174;
- @html.gsub!(/°/,'&deg;') # &#176;
- @html.gsub!(/±/,'&plusmn;') # &#177;
- @html.gsub!(/²/,'&sup2;') # &#178;
- @html.gsub!(/³/,'&sup3;') # &#179;
- @html.gsub!(/µ/,'&micro;') # &#181;
- @html.gsub!(/¶/,'&para;') # &#182;
- @html.gsub!(/¹/,'&sup1;') # &#185;
- @html.gsub!(/º/,'&ordm;') # &#186;
- @html.gsub!(/»/,'&raquo;') # &#187;
- @html.gsub!(/¼/,'&frac14;') # &#188;
- @html.gsub!(/½/,'&frac12;') # &#189;
- @html.gsub!(/¾/,'&frac34;') # &#190;
- @html.gsub!(/×/,'&times;') # &#215;
- @html.gsub!(/÷/,'&divide;') # &#247;
- @html.gsub!(/¿/,'&iquest;') # &#191;
- @html.gsub!(/À/,'&Agrave;') # &#192;
- @html.gsub!(/Á/,'&Aacute;') # &#193;
- @html.gsub!(/Â/,'&Acirc;') # &#194;
- @html.gsub!(/Ã/,'&Atilde;') # &#195;
- @html.gsub!(/Ä/,'&Auml;') # &#196;
- @html.gsub!(/Å/,'&Aring;') # &#197;
- @html.gsub!(/Æ/,'&AElig;') # &#198;
- @html.gsub!(/Ç/,'&Ccedil;') # &#199;
- @html.gsub!(/È/,'&Egrave;') # &#200;
- @html.gsub!(/É/,'&Eacute;') # &#201;
- @html.gsub!(/Ê/,'&Ecirc;') # &#202;
- @html.gsub!(/Ë/,'&Euml;') # &#203;
- @html.gsub!(/Ì/,'&Igrave;') # &#204;
- @html.gsub!(/Í/,'&Iacute;') # &#205;
- @html.gsub!(/Î/,'&Icirc;') # &#206;
- @html.gsub!(/Ï/,'&Iuml;') # &#207;
- @html.gsub!(/Ð/,'&ETH;') # &#208;
- @html.gsub!(/Ñ/,'&Ntilde;') # &#209;
- @html.gsub!(/Ò/,'&Ograve;') # &#210;
- @html.gsub!(/Ó/,'&Oacute;') # &#211;
- @html.gsub!(/Ô/,'&Ocirc;') # &#212;
- @html.gsub!(/Õ/,'&Otilde;') # &#213;
- @html.gsub!(/Ö/,'&Ouml;') # &#214;
- @html.gsub!(/Ø/,'&Oslash;') # &#216;
- @html.gsub!(/Ù/,'&Ugrave;') # &#217;
- @html.gsub!(/Ú/,'&Uacute;') # &#218;
- @html.gsub!(/Û/,'&Ucirc;') # &#219;
- @html.gsub!(/Ü/,'&Uuml;') # &#220;
- @html.gsub!(/Ý/,'&Yacute;') # &#221;
- @html.gsub!(/Þ/,'&THORN;') # &#222;
- @html.gsub!(/ß/,'&szlig;') # &#223;
- @html.gsub!(/à/,'&agrave;') # &#224;
- @html.gsub!(/á/,'&aacute;') # &#225;
- @html.gsub!(/â/,'&acirc;') # &#226;
- @html.gsub!(/ã/,'&atilde;') # &#227;
- @html.gsub!(/ä/,'&auml;') # &#228;
- @html.gsub!(/å/,'&aring;') # &#229;
- @html.gsub!(/æ/,'&aelig;') # &#230;
- @html.gsub!(/ç/,'&ccedil;') # &#231;
- @html.gsub!(/è/,'&egrave;') # &#232;
- @html.gsub!(/é/,'&eacute;') # &#233;
- @html.gsub!(/ê/,'&ecirc;') # &#234;
- @html.gsub!(/ë/,'&euml;') # &#235;
- @html.gsub!(/ì/,'&igrave;') # &#236;
- @html.gsub!(/í/,'&iacute;') # &#237;
- @html.gsub!(/î/,'&icirc;') # &#238;
- @html.gsub!(/ï/,'&iuml;') # &#239;
- @html.gsub!(/ð/,'&eth;') # &#240;
- @html.gsub!(/ñ/,'&ntilde;') # &#241;
- @html.gsub!(/ò/,'&ograve;') # &#242;
- @html.gsub!(/ó/,'&oacute;') # &#243;
- @html.gsub!(/ô/,'&ocirc;') # &#244;
- @html.gsub!(/õ/,'&otilde;') # &#245;
- @html.gsub!(/ö/,'&ouml;') # &#246;
- @html.gsub!(/ø/,'&oslash;') # &#248;
- @html.gsub!(/ù/,'&ugrave;') # &#250;
- @html.gsub!(/ú/,'&uacute;') # &#251;
- @html.gsub!(/û/,'&ucirc;') # &#252;
- @html.gsub!(/ü/,'&uuml;') # &#253;
- @html.gsub!(/þ/,'&thorn;') # &#254;
- @html.gsub!(/ÿ/,'&yuml;') # &#255;
- @html.gsub!(/ý/,'&yacute;')
+ @html.gsub!(/¢/u,'&cent;') # &#162;
+ @html.gsub!(/£/u,'&pound;') # &#163;
+ @html.gsub!(/¥/u,'&yen;') # &#165;
+ @html.gsub!(/§/u,'&sect;') # &#167;
+ @html.gsub!(/©/u,'&copy;') # &#169;
+ @html.gsub!(/ª/u,'&ordf;') # &#170;
+ @html.gsub!(/«/u,'&laquo;') # &#171;
+ @html.gsub!(/®/u,'&reg;') # &#174;
+ @html.gsub!(/°/u,'&deg;') # &#176;
+ @html.gsub!(/±/u,'&plusmn;') # &#177;
+ @html.gsub!(/²/u,'&sup2;') # &#178;
+ @html.gsub!(/³/u,'&sup3;') # &#179;
+ @html.gsub!(/µ/u,'&micro;') # &#181;
+ @html.gsub!(/¶/u,'&para;') # &#182;
+ @html.gsub!(/¹/u,'&sup1;') # &#185;
+ @html.gsub!(/º/u,'&ordm;') # &#186;
+ @html.gsub!(/»/u,'&raquo;') # &#187;
+ @html.gsub!(/¼/u,'&frac14;') # &#188;
+ @html.gsub!(/½/u,'&frac12;') # &#189;
+ @html.gsub!(/¾/u,'&frac34;') # &#190;
+ @html.gsub!(/×/u,'&times;') # &#215;
+ @html.gsub!(/÷/u,'&divide;') # &#247;
+ @html.gsub!(/¿/u,'&iquest;') # &#191;
+ @html.gsub!(/À/u,'&Agrave;') # &#192;
+ @html.gsub!(/Á/u,'&Aacute;') # &#193;
+ @html.gsub!(/Â/u,'&Acirc;') # &#194;
+ @html.gsub!(/Ã/u,'&Atilde;') # &#195;
+ @html.gsub!(/Ä/u,'&Auml;') # &#196;
+ @html.gsub!(/Å/u,'&Aring;') # &#197;
+ @html.gsub!(/Æ/u,'&AElig;') # &#198;
+ @html.gsub!(/Ç/u,'&Ccedil;') # &#199;
+ @html.gsub!(/È/u,'&Egrave;') # &#200;
+ @html.gsub!(/É/u,'&Eacute;') # &#201;
+ @html.gsub!(/Ê/u,'&Ecirc;') # &#202;
+ @html.gsub!(/Ë/u,'&Euml;') # &#203;
+ @html.gsub!(/Ì/u,'&Igrave;') # &#204;
+ @html.gsub!(/Í/u,'&Iacute;') # &#205;
+ @html.gsub!(/Î/u,'&Icirc;') # &#206;
+ @html.gsub!(/Ï/u,'&Iuml;') # &#207;
+ @html.gsub!(/Ð/u,'&ETH;') # &#208;
+ @html.gsub!(/Ñ/u,'&Ntilde;') # &#209;
+ @html.gsub!(/Ò/u,'&Ograve;') # &#210;
+ @html.gsub!(/Ó/u,'&Oacute;') # &#211;
+ @html.gsub!(/Ô/u,'&Ocirc;') # &#212;
+ @html.gsub!(/Õ/u,'&Otilde;') # &#213;
+ @html.gsub!(/Ö/u,'&Ouml;') # &#214;
+ @html.gsub!(/Ø/u,'&Oslash;') # &#216;
+ @html.gsub!(/Ù/u,'&Ugrave;') # &#217;
+ @html.gsub!(/Ú/u,'&Uacute;') # &#218;
+ @html.gsub!(/Û/u,'&Ucirc;') # &#219;
+ @html.gsub!(/Ü/u,'&Uuml;') # &#220;
+ @html.gsub!(/Ý/u,'&Yacute;') # &#221;
+ @html.gsub!(/Þ/u,'&THORN;') # &#222;
+ @html.gsub!(/ß/u,'&szlig;') # &#223;
+ @html.gsub!(/à/u,'&agrave;') # &#224;
+ @html.gsub!(/á/u,'&aacute;') # &#225;
+ @html.gsub!(/â/u,'&acirc;') # &#226;
+ @html.gsub!(/ã/u,'&atilde;') # &#227;
+ @html.gsub!(/ä/u,'&auml;') # &#228;
+ @html.gsub!(/å/u,'&aring;') # &#229;
+ @html.gsub!(/æ/u,'&aelig;') # &#230;
+ @html.gsub!(/ç/u,'&ccedil;') # &#231;
+ @html.gsub!(/è/u,'&egrave;') # &#232;
+ @html.gsub!(/é/u,'&eacute;') # &#233;
+ @html.gsub!(/ê/u,'&ecirc;') # &#234;
+ @html.gsub!(/ë/u,'&euml;') # &#235;
+ @html.gsub!(/ì/u,'&igrave;') # &#236;
+ @html.gsub!(/í/u,'&iacute;') # &#237;
+ @html.gsub!(/î/u,'&icirc;') # &#238;
+ @html.gsub!(/ï/u,'&iuml;') # &#239;
+ @html.gsub!(/ð/u,'&eth;') # &#240;
+ @html.gsub!(/ñ/u,'&ntilde;') # &#241;
+ @html.gsub!(/ò/u,'&ograve;') # &#242;
+ @html.gsub!(/ó/u,'&oacute;') # &#243;
+ @html.gsub!(/ô/u,'&ocirc;') # &#244;
+ @html.gsub!(/õ/u,'&otilde;') # &#245;
+ @html.gsub!(/ö/u,'&ouml;') # &#246;
+ @html.gsub!(/ø/u,'&oslash;') # &#248;
+ @html.gsub!(/ù/u,'&ugrave;') # &#250;
+ @html.gsub!(/ú/u,'&uacute;') # &#251;
+ @html.gsub!(/û/u,'&ucirc;') # &#252;
+ @html.gsub!(/ü/u,'&uuml;') # &#253;
+ @html.gsub!(/þ/u,'&thorn;') # &#254;
+ @html.gsub!(/ÿ/u,'&yuml;') # &#255;
+ @html.gsub!(/ý/u,'&yacute;')
@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!(/<!Th?¡.+/m,"#@br#{table_message}")
+ para.gsub!(/<!Th?¡.+/um,"#@br#{table_message}")
para.gsub!(/.+?<-#>/,'') # remove dummy headings (used by html) #check
para.gsub!(/_\*\s+/,'* ') # bullet markup, marked down
para.gsub!(/<sup>(.+?)<\/sup>/,'^\1^')
@@ -449,7 +449,7 @@ WOK
#formatMono=MonoSiSU.new('<br /><a name="owner.details">Owner Details</a>')
#@@manpage[:owner_details]=formatMono.bold_para
#para=''
- elsif para =~/(¡|<!Th?)/ #tables !
+ elsif para =~/(¡|<!Th?)/u #tables !
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 =~ /<!Th?/ #elsif para =~ /<!Th?¡/
+ elsif para =~ /<!Th?/ #elsif para =~ /<!Th?¡/u
@@odf[:body] << table(para)
@@odf[:body] << @br*2
else
@@ -457,7 +457,7 @@ module SiSU_ODF
wordlist
end
def markup(data) # Used for major markup instructions
- safe_characters=/[^a-zA-Z0-9}{\/?,."';:)(><\-_&!@%~#\]\[*=$| \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>(.+?)<\/sup>/,'<text:span text:style-name="T4">\1</text:span>')
para.gsub!(/<sub>(.+?)<\/sub>/,'<text:span text:style-name="T5">\1</text:span>')
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,'&#060;')
para.gsub!(/\\copy(?:right)?\b/,'&#169;')
para.gsub!(/\\trademark\b|\\tm\b/,'&#174;')
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[/<!f(.+?)!>/,1]
@@tablefoot << m if m
@parablock.gsub!(/<!f.+?!>/,'')
- @@tablehead=1 if @parablock =~/<!Th¡/
- @@table_counter+=1 if @parablock =~/<!Th?¡/
- if @parablock =~/<!Th¡\s+c(\d+).+?!~\d+;\w\d+;\w\d+>/; @parablock=table_head(@@table_counter,$1,true)
- elsif @parablock =~/<!T¡\s+c(\d+).+?!~\d+;\w\d+;\w\d+>/; @parablock=table_head(@@table_counter,$1)
+ @@tablehead=1 if @parablock =~/<!Th¡/u
+ @@table_counter+=1 if @parablock =~/<!Th?¡/u
+ if @parablock =~/<!Th¡\s+c(\d+).+?!~\d+;\w\d+;\w\d+>/u; @parablock=table_head(@@table_counter,$1,true)
+ elsif @parablock =~/<!T¡\s+c(\d+).+?!~\d+;\w\d+;\w\d+>/u; @parablock=table_head(@@table_counter,$1)
end
if @parablock =~/<!TZ!>/
tablefoot=[]
@@ -194,12 +194,12 @@ module OD_format
end
end
if @@tablehead == 1
- if @parablock =~/¡¡/
- if @parablock =~/<!¡¡(\d+?)¡/
- @parablock.gsub!(/<!¡¡(\d+?)¡/,table_row($1,true))
+ if @parablock =~/¡¡/u
+ if @parablock =~/<!¡¡(\d+?)¡/u
+ @parablock.gsub!(/<!¡¡(\d+?)¡/u,table_row($1,true))
end
- if @parablock =~/¡¡(\d+?)¡/
- @parablock.gsub!(/¡¡(\d+?)¡/,table_cell($1,true))
+ if @parablock =~/¡¡(\d+?)¡/u
+ @parablock.gsub!(/¡¡(\d+?)¡/u,table_cell($1,true))
end
if @parablock =~/!>/
@parablock.gsub!(/!>/,table_row_close(true))
@@ -208,11 +208,11 @@ module OD_format
end
@parablock
else
- if @parablock =~/<!¡¡(\d+?)¡/
- @parablock.gsub!(/<!¡¡(\d+?)¡/,table_row($1))
+ if @parablock =~/<!¡¡(\d+?)¡/u
+ @parablock.gsub!(/<!¡¡(\d+?)¡/u,table_row($1))
end
- if @parablock =~/¡¡(\d+?)¡/
- @parablock.gsub!(/¡¡(\d+?)¡/,table_cell($1))
+ if @parablock =~/¡¡(\d+?)¡/u
+ @parablock.gsub!(/¡¡(\d+?)¡/u,table_cell($1))
end
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!(/<!Th?¡.+/m,"#@br#{table_message}")
+ para.gsub!(/<!Th?¡.+/um,"#@br#{table_message}")
para.gsub!(/.+?<-#>/,'') # remove dummy headings (used by html) #check
para.gsub!(/_\*\s+/,'* ') # bullet markup, marked down
para.gsub!(/<sup>(.+?)<\/sup>/,'^\1^')
@@ -436,7 +436,7 @@ WOK
#formatMono=MonoSiSU.new('<br /><a name="owner.details">Owner Details</a>')
#@plaintext[:owner_details]=formatMono.bold_para
#para=''
- elsif para =~/(¡|<!Th?)/ #tables !
+ elsif para =~/(¡|<!Th?)/u #tables !
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[/<!f(.+?)!>/,1]
@@tablefoot<<m if m
parablock.gsub!(/<!f.+?!>/,'')
- @@tablehead=1 if parablock =~/<!Th¡/
+ @@tablehead=1 if parablock =~/<!Th¡/u
parablock.gsub!(/<!Th?¡.+?!~(\d+)>/,
#%{<table summary="normal text css" width="100%" border="0" bgcolor="white" cellpadding="2" align="center"><tr><td valign="top" align="justify"><p class="norm" id="\\1"> </p> </td><td>\n} +
%{<table summary="normal text css" width="100%" border="0" bgcolor="white" cellpadding="2" align="center">})
@@ -207,12 +207,12 @@ GSUB
#%{#{tablefoot}})
end
if @@tablehead == 1
- if parablock =~/¡¡/
- parablock.gsub!(/<!¡¡(\d+?)¡/,
+ if parablock =~/¡¡/u
+ parablock.gsub!(/<!¡¡(\d+?)¡/u,
%{\n<tr>} +
%{\n<td width="\\1%" valign="top">} +
%{#{para_table}<b>})
- parablock.gsub!(/¡¡(\d+?)¡/,
+ parablock.gsub!(/¡¡(\d+?)¡/u,
%{</b></td><td width="\\1%" valign="top">} +
%{#{para_table}<b>})
parablock.gsub!(/!>/, '</b></td></tr>')
@@ -220,11 +220,11 @@ GSUB
end
parablock
else
- parablock.gsub!(/<!¡¡(\d+?)¡/,
+ parablock.gsub!(/<!¡¡(\d+?)¡/u,
%{\n<tr>} +
%{\n<td width="\\1%" valign="top">} +
%{#{para_table}})
- parablock.gsub!(/¡¡(\d+?)¡/,
+ parablock.gsub!(/¡¡(\d+?)¡/u,
%{</td><td width="\\1%" valign="top">} +
%{#{para_table}})
parablock.gsub!(/!>/, '</td></tr>')
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!(/¢/, '&#162;') # '&cent;' # &#162;
- para.gsub!(/£/, '&#163;') # '&pound;' # &#163;
- para.gsub!(/¥/, '&#165;') # '&yen;' # &#165;
- para.gsub!(/§/, '&#167;') # '&sect;' # &#167;
- para.gsub!(/©/, '&#169;') # '&copy;' # &#169;
- para.gsub!(/ª/, '&#170;') # '&ordf;' # &#170;
- para.gsub!(/«/, '&#171;') # '&laquo;' # &#171;
- para.gsub!(/®/, '&#174;') # '&reg;' # &#174;
- para.gsub!(/°/, '&#176;') # '&deg;' # &#176;
- para.gsub!(/±/, '&#177;') # '&plusmn;' # &#177;
- para.gsub!(/²/, '&#178;') # '&sup2;' # &#178;
- para.gsub!(/³/, '&#179;') # '&sup3;' # &#179;
- para.gsub!(/µ/, '&#181;') # '&micro;' # &#181;
- para.gsub!(/¶/, '&#182;') # '&para;' # &#182;
- para.gsub!(/¹/, '&#185;') # '&sup1;' # &#185;
- para.gsub!(/º/, '&#186;') # '&ordm;' # &#186;
- para.gsub!(/»/, '&#187;') # '&raquo;' # &#187;
- para.gsub!(/¼/, '&#188;') # '&frac14;' # &#188;
- para.gsub!(/½/, '&#189;') # '&frac12;' # &#189;
- para.gsub!(/¾/, '&#190;') # '&frac34;' # &#190;
- para.gsub!(/×/, '&#215;') # '&times;' # &#215;
- para.gsub!(/÷/, '&#247;') # '&divide;' # &#247;
- para.gsub!(/¿/, '&#191;') # '&iquest;' # &#191;
- para.gsub!(/À/, '&#192;') # '&Agrave;' # &#192;
- para.gsub!(/Á/, '&#193;') # '&Aacute;' # &#193;
- para.gsub!(/Â/, '&#194;') # '&Acirc;' # &#194;
- para.gsub!(/Ã/, '&#195;') # '&Atilde;' # &#195;
- para.gsub!(/Ä/, '&#196;') # '&Auml;' # &#196;
- para.gsub!(/Å/, '&#197;') # '&Aring;' # &#197;
- para.gsub!(/Æ/, '&#198;') # '&AElig;' # &#198;
- para.gsub!(/Ç/, '&#199;') # '&Ccedil;' # &#199;
- para.gsub!(/È/, '&#200;') # '&Egrave;' # &#200;
- para.gsub!(/É/, '&#201;') # '&Eacute;' # &#201;
- para.gsub!(/Ê/, '&#202;') # '&Ecirc;' # &#202;
- para.gsub!(/Ë/, '&#203;') # '&Euml;' # &#203;
- para.gsub!(/Ì/, '&#204;') # '&Igrave;' # &#204;
- para.gsub!(/Í/, '&#205;') # '&Iacute;' # &#205;
- para.gsub!(/Î/, '&#206;') # '&Icirc;' # &#206;
- para.gsub!(/Ï/, '&#207;') # '&Iuml;' # &#207;
- para.gsub!(/Ð/, '&#208;') # '&ETH;' # &#208;
- para.gsub!(/Ñ/, '&#209;') # '&Ntilde;' # &#209;
- para.gsub!(/Ò/, '&#210;') # '&Ograve;' # &#210;
- para.gsub!(/Ó/, '&#211;') # '&Oacute;' # &#211;
- para.gsub!(/Ô/, '&#212;') # '&Ocirc;' # &#212;
- para.gsub!(/Õ/, '&#213;') # '&Otilde;' # &#213;
- para.gsub!(/Ö/, '&#214;') # '&Ouml;' # &#214;
- para.gsub!(/Ø/, '&#216;') # '&Oslash;' # &#216;
- para.gsub!(/Ù/, '&#217;') # '&Ugrave;' # &#217;
- para.gsub!(/Ú/, '&#218;') # '&Uacute;' # &#218;
- para.gsub!(/Û/, '&#219;') # '&Ucirc;' # &#219;
- para.gsub!(/Ü/, '&#220;') # '&Uuml;' # &#220;
- para.gsub!(/Ý/, '&#221;') # '&Yacute;' # &#221;
- para.gsub!(/Þ/, '&#222;') # '&THORN;' # &#222;
- para.gsub!(/ß/, '&#223;') # '&szlig;' # &#223;
- para.gsub!(/à/, '&#224;') # '&agrave;' # &#224;
- para.gsub!(/á/, '&#225;') # '&aacute;' # &#225;
- para.gsub!(/â/, '&#226;') # '&acirc;' # &#226;
- para.gsub!(/ã/, '&#227;') # '&atilde;' # &#227;
- para.gsub!(/ä/, '&#228;') # '&auml;' # &#228;
- para.gsub!(/å/, '&#229;') # '&aring;' # &#229;
- para.gsub!(/æ/, '&#230;') # '&aelig;' # &#230;
- para.gsub!(/ç/, '&#231;') # '&ccedil;' # &#231;
- para.gsub!(/è/, '&#232;') # '&egrave;' # &#232;
- para.gsub!(/é/, '&#233;') # '&acute;' # &#233;
- para.gsub!(/ê/, '&#234;') # '&circ;' # &#234;
- para.gsub!(/ë/, '&#235;') # '&euml;' # &#235;
- para.gsub!(/ì/, '&#236;') # '&igrave;' # &#236;
- para.gsub!(/í/, '&#237;') # '&acute;' # &#237;
- para.gsub!(/î/, '&#238;') # '&icirc;' # &#238;
- para.gsub!(/ï/, '&#239;') # '&iuml;' # &#239;
- para.gsub!(/ð/, '&#240;') # '&eth;' # &#240;
- para.gsub!(/ñ/, '&#241;') # '&ntilde;' # &#241;
- para.gsub!(/ò/, '&#242;') # '&ograve;' # &#242;
- para.gsub!(/ó/, '&#243;') # '&oacute;' # &#243;
- para.gsub!(/ô/, '&#244;') # '&ocirc;' # &#244;
- para.gsub!(/õ/, '&#245;') # '&otilde;' # &#245;
- para.gsub!(/ö/, '&#246;') # '&ouml;' # &#246;
- para.gsub!(/ø/, '&#248;') # '&oslash;' # &#248;
- para.gsub!(/ù/, '&#250;') # '&ugrave;' # &#250;
- para.gsub!(/ú/, '&#251;') # '&uacute;' # &#251;
- para.gsub!(/û/, '&#252;') # '&ucirc;' # &#252;
- para.gsub!(/ü/, '&#253;') # '&uuml;' # &#253;
- para.gsub!(/þ/, '&#254;') # '&thorn;' # &#254;
- para.gsub!(/ÿ/, '&#255;') # '&yuml;' # &#255;
+ para.gsub!(/¢/u, '&#162;') # '&cent;' # &#162;
+ para.gsub!(/£/u, '&#163;') # '&pound;' # &#163;
+ para.gsub!(/¥/u, '&#165;') # '&yen;' # &#165;
+ para.gsub!(/§/u, '&#167;') # '&sect;' # &#167;
+ para.gsub!(/©/u, '&#169;') # '&copy;' # &#169;
+ para.gsub!(/ª/u, '&#170;') # '&ordf;' # &#170;
+ para.gsub!(/«/u, '&#171;') # '&laquo;' # &#171;
+ para.gsub!(/®/u, '&#174;') # '&reg;' # &#174;
+ para.gsub!(/°/u, '&#176;') # '&deg;' # &#176;
+ para.gsub!(/±/u, '&#177;') # '&plusmn;' # &#177;
+ para.gsub!(/²/u, '&#178;') # '&sup2;' # &#178;
+ para.gsub!(/³/u, '&#179;') # '&sup3;' # &#179;
+ para.gsub!(/µ/u, '&#181;') # '&micro;' # &#181;
+ para.gsub!(/¶/u, '&#182;') # '&para;' # &#182;
+ para.gsub!(/¹/u, '&#185;') # '&sup1;' # &#185;
+ para.gsub!(/º/u, '&#186;') # '&ordm;' # &#186;
+ para.gsub!(/»/u, '&#187;') # '&raquo;' # &#187;
+ para.gsub!(/¼/u, '&#188;') # '&frac14;' # &#188;
+ para.gsub!(/½/u, '&#189;') # '&frac12;' # &#189;
+ para.gsub!(/¾/u, '&#190;') # '&frac34;' # &#190;
+ para.gsub!(/×/u, '&#215;') # '&times;' # &#215;
+ para.gsub!(/÷/u, '&#247;') # '&divide;' # &#247;
+ para.gsub!(/¿/u, '&#191;') # '&iquest;' # &#191;
+ para.gsub!(/À/u, '&#192;') # '&Agrave;' # &#192;
+ para.gsub!(/Á/u, '&#193;') # '&Aacute;' # &#193;
+ para.gsub!(/Â/u, '&#194;') # '&Acirc;' # &#194;
+ para.gsub!(/Ã/u, '&#195;') # '&Atilde;' # &#195;
+ para.gsub!(/Ä/u, '&#196;') # '&Auml;' # &#196;
+ para.gsub!(/Å/u, '&#197;') # '&Aring;' # &#197;
+ para.gsub!(/Æ/u, '&#198;') # '&AElig;' # &#198;
+ para.gsub!(/Ç/u, '&#199;') # '&Ccedil;' # &#199;
+ para.gsub!(/È/u, '&#200;') # '&Egrave;' # &#200;
+ para.gsub!(/É/u, '&#201;') # '&Eacute;' # &#201;
+ para.gsub!(/Ê/u, '&#202;') # '&Ecirc;' # &#202;
+ para.gsub!(/Ë/u, '&#203;') # '&Euml;' # &#203;
+ para.gsub!(/Ì/u, '&#204;') # '&Igrave;' # &#204;
+ para.gsub!(/Í/u, '&#205;') # '&Iacute;' # &#205;
+ para.gsub!(/Î/u, '&#206;') # '&Icirc;' # &#206;
+ para.gsub!(/Ï/u, '&#207;') # '&Iuml;' # &#207;
+ para.gsub!(/Ð/u, '&#208;') # '&ETH;' # &#208;
+ para.gsub!(/Ñ/u, '&#209;') # '&Ntilde;' # &#209;
+ para.gsub!(/Ò/u, '&#210;') # '&Ograve;' # &#210;
+ para.gsub!(/Ó/u, '&#211;') # '&Oacute;' # &#211;
+ para.gsub!(/Ô/u, '&#212;') # '&Ocirc;' # &#212;
+ para.gsub!(/Õ/u, '&#213;') # '&Otilde;' # &#213;
+ para.gsub!(/Ö/u, '&#214;') # '&Ouml;' # &#214;
+ para.gsub!(/Ø/u, '&#216;') # '&Oslash;' # &#216;
+ para.gsub!(/Ù/u, '&#217;') # '&Ugrave;' # &#217;
+ para.gsub!(/Ú/u, '&#218;') # '&Uacute;' # &#218;
+ para.gsub!(/Û/u, '&#219;') # '&Ucirc;' # &#219;
+ para.gsub!(/Ü/u, '&#220;') # '&Uuml;' # &#220;
+ para.gsub!(/Ý/u, '&#221;') # '&Yacute;' # &#221;
+ para.gsub!(/Þ/u, '&#222;') # '&THORN;' # &#222;
+ para.gsub!(/ß/u, '&#223;') # '&szlig;' # &#223;
+ para.gsub!(/à/u, '&#224;') # '&agrave;' # &#224;
+ para.gsub!(/á/u, '&#225;') # '&aacute;' # &#225;
+ para.gsub!(/â/u, '&#226;') # '&acirc;' # &#226;
+ para.gsub!(/ã/u, '&#227;') # '&atilde;' # &#227;
+ para.gsub!(/ä/u, '&#228;') # '&auml;' # &#228;
+ para.gsub!(/å/u, '&#229;') # '&aring;' # &#229;
+ para.gsub!(/æ/u, '&#230;') # '&aelig;' # &#230;
+ para.gsub!(/ç/u, '&#231;') # '&ccedil;' # &#231;
+ para.gsub!(/è/u, '&#232;') # '&egrave;' # &#232;
+ para.gsub!(/é/u, '&#233;') # '&acute;' # &#233;
+ para.gsub!(/ê/u, '&#234;') # '&circ;' # &#234;
+ para.gsub!(/ë/u, '&#235;') # '&euml;' # &#235;
+ para.gsub!(/ì/u, '&#236;') # '&igrave;' # &#236;
+ para.gsub!(/í/u, '&#237;') # '&acute;' # &#237;
+ para.gsub!(/î/u, '&#238;') # '&icirc;' # &#238;
+ para.gsub!(/ï/u, '&#239;') # '&iuml;' # &#239;
+ para.gsub!(/ð/u, '&#240;') # '&eth;' # &#240;
+ para.gsub!(/ñ/u, '&#241;') # '&ntilde;' # &#241;
+ para.gsub!(/ò/u, '&#242;') # '&ograve;' # &#242;
+ para.gsub!(/ó/u, '&#243;') # '&oacute;' # &#243;
+ para.gsub!(/ô/u, '&#244;') # '&ocirc;' # &#244;
+ para.gsub!(/õ/u, '&#245;') # '&otilde;' # &#245;
+ para.gsub!(/ö/u, '&#246;') # '&ouml;' # &#246;
+ para.gsub!(/ø/u, '&#248;') # '&oslash;' # &#248;
+ para.gsub!(/ù/u, '&#250;') # '&ugrave;' # &#250;
+ para.gsub!(/ú/u, '&#251;') # '&uacute;' # &#251;
+ para.gsub!(/û/u, '&#252;') # '&ucirc;' # &#252;
+ para.gsub!(/ü/u, '&#253;') # '&uuml;' # &#253;
+ para.gsub!(/þ/u, '&#254;') # '&thorn;' # &#254;
+ para.gsub!(/ÿ/u, '&#255;') # '&yuml;' # &#255;
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!(/¢/, '&cent;') # &#162;
- para.gsub!(/£/, '&pound;') # &#163;
- para.gsub!(/¥/, '&yen;') # &#165;
- para.gsub!(/§/, '&sect;') # &#167;
- para.gsub!(/©/, '&copy;') # &#169;
- para.gsub!(/ª/, '&ordf;') # &#170;
- para.gsub!(/«/, '&laquo;') # &#171;
- para.gsub!(/®/, '&reg;') # &#174;
- para.gsub!(/°/, '&deg;') # &#176;
- para.gsub!(/±/, '&plusmn;') # &#177;
- para.gsub!(/²/, '&sup2;') # &#178;
- para.gsub!(/³/, '&sup3;') # &#179;
- para.gsub!(/µ/, '&micro;') # &#181;
- para.gsub!(/¶/, '&para;') # &#182;
- para.gsub!(/¹/, '&sup1;') # &#185;
- para.gsub!(/º/, '&ordm;') # &#186;
- para.gsub!(/»/, '&raquo;') # &#187;
- para.gsub!(/¼/, '&frac14;') # &#188;
- para.gsub!(/½/, '&frac12;') # &#189;
- para.gsub!(/¾/, '&frac34;') # &#190;
- para.gsub!(/×/, '&times;') # &#215;
- para.gsub!(/÷/, '&divide;') # &#247;
- para.gsub!(/¿/, '&iquest;') # &#191;
- para.gsub!(/À/, '&Agrave;') # &#192;
- para.gsub!(/Á/, '&Aacute;') # &#193;
- para.gsub!(/Â/, '&Acirc;') # &#194;
- para.gsub!(/Ã/, '&Atilde;') # &#195;
- para.gsub!(/Ä/, '&Auml;') # &#196;
- para.gsub!(/Å/, '&Aring;') # &#197;
- para.gsub!(/Æ/, '&AElig;') # &#198;
- para.gsub!(/Ç/, '&Ccedil;') # &#199;
- para.gsub!(/È/, '&Egrave;') # &#200;
- para.gsub!(/É/, '&Eacute;') # &#201;
- para.gsub!(/Ê/, '&Ecirc;') # &#202;
- para.gsub!(/Ë/, '&Euml;') # &#203;
- para.gsub!(/Ì/, '&Igrave;') # &#204;
- para.gsub!(/Í/, '&Iacute;') # &#205;
- para.gsub!(/Î/, '&Icirc;') # &#206;
- para.gsub!(/Ï/, '&Iuml;') # &#207;
- para.gsub!(/Ð/, '&ETH;') # &#208;
- para.gsub!(/Ñ/, '&Ntilde;') # &#209;
- para.gsub!(/Ò/, '&Ograve;') # &#210;
- para.gsub!(/Ó/, '&Oacute;') # &#211;
- para.gsub!(/Ô/, '&Ocirc;') # &#212;
- para.gsub!(/Õ/, '&Otilde;') # &#213;
- para.gsub!(/Ö/, '&Ouml;') # &#214;
- para.gsub!(/Ø/, '&Oslash;') # &#216;
- para.gsub!(/Ù/, '&Ugrave;') # &#217;
- para.gsub!(/Ú/, '&Uacute;') # &#218;
- para.gsub!(/Û/, '&Ucirc;') # &#219;
- para.gsub!(/Ü/, '&Uuml;') # &#220;
- para.gsub!(/Ý/, '&Yacute;') # &#221;
- para.gsub!(/Þ/, '&THORN;') # &#222;
- para.gsub!(/ß/, '&szlig;') # &#223;
- para.gsub!(/à/, '&agrave;') # &#224;
- para.gsub!(/á/, '&aacute;') # &#225;
- para.gsub!(/â/, '&acirc;') # &#226;
- para.gsub!(/ã/, '&atilde;') # &#227;
- para.gsub!(/ä/, '&auml;') # &#228;
- para.gsub!(/å/, '&aring;') # &#229;
- para.gsub!(/æ/, '&aelig;') # &#230;
- para.gsub!(/ç/, '&ccedil;') # &#231;
- para.gsub!(/è/, '&egrave;') # &#232;
- para.gsub!(/é/, '&acute;') # &#233;
- para.gsub!(/ê/, '&circ;') # &#234;
- para.gsub!(/ë/, '&euml;') # &#235;
- para.gsub!(/ì/, '&igrave;') # &#236;
- para.gsub!(/í/, '&acute;') # &#237;
- para.gsub!(/î/, '&icirc;') # &#238;
- para.gsub!(/ï/, '&iuml;') # &#239;
- para.gsub!(/ð/, '&eth;') # &#240;
- para.gsub!(/ñ/, '&ntilde;') # &#241;
- para.gsub!(/ò/, '&ograve;') # &#242;
- para.gsub!(/ó/, '&oacute;') # &#243;
- para.gsub!(/ô/, '&ocirc;') # &#244;
- para.gsub!(/õ/, '&otilde;') # &#245;
- para.gsub!(/ö/, '&ouml;') # &#246;
- para.gsub!(/ø/, '&oslash;') # &#248;
- para.gsub!(/ù/, '&ugrave;') # &#250;
- para.gsub!(/ú/, '&uacute;') # &#251;
- para.gsub!(/û/, '&ucirc;') # &#252;
- para.gsub!(/ü/, '&uuml;') # &#253;
- para.gsub!(/þ/, '&thorn;') # &#254;
- para.gsub!(/ÿ/, '&yuml;') # &#255;
+ para.gsub!(/¢/u, '&cent;') # &#162;
+ para.gsub!(/£/u, '&pound;') # &#163;
+ para.gsub!(/¥/u, '&yen;') # &#165;
+ para.gsub!(/§/u, '&sect;') # &#167;
+ para.gsub!(/©/u, '&copy;') # &#169;
+ para.gsub!(/ª/u, '&ordf;') # &#170;
+ para.gsub!(/«/u, '&laquo;') # &#171;
+ para.gsub!(/®/u, '&reg;') # &#174;
+ para.gsub!(/°/u, '&deg;') # &#176;
+ para.gsub!(/±/u, '&plusmn;') # &#177;
+ para.gsub!(/²/u, '&sup2;') # &#178;
+ para.gsub!(/³/u, '&sup3;') # &#179;
+ para.gsub!(/µ/u, '&micro;') # &#181;
+ para.gsub!(/¶/u, '&para;') # &#182;
+ para.gsub!(/¹/u, '&sup1;') # &#185;
+ para.gsub!(/º/u, '&ordm;') # &#186;
+ para.gsub!(/»/u, '&raquo;') # &#187;
+ para.gsub!(/¼/u, '&frac14;') # &#188;
+ para.gsub!(/½/u, '&frac12;') # &#189;
+ para.gsub!(/¾/u, '&frac34;') # &#190;
+ para.gsub!(/×/u, '&times;') # &#215;
+ para.gsub!(/÷/u, '&divide;') # &#247;
+ para.gsub!(/¿/u, '&iquest;') # &#191;
+ para.gsub!(/À/u, '&Agrave;') # &#192;
+ para.gsub!(/Á/u, '&Aacute;') # &#193;
+ para.gsub!(/Â/u, '&Acirc;') # &#194;
+ para.gsub!(/Ã/u, '&Atilde;') # &#195;
+ para.gsub!(/Ä/u, '&Auml;') # &#196;
+ para.gsub!(/Å/u, '&Aring;') # &#197;
+ para.gsub!(/Æ/u, '&AElig;') # &#198;
+ para.gsub!(/Ç/u, '&Ccedil;') # &#199;
+ para.gsub!(/È/u, '&Egrave;') # &#200;
+ para.gsub!(/É/u, '&Eacute;') # &#201;
+ para.gsub!(/Ê/u, '&Ecirc;') # &#202;
+ para.gsub!(/Ë/u, '&Euml;') # &#203;
+ para.gsub!(/Ì/u, '&Igrave;') # &#204;
+ para.gsub!(/Í/u, '&Iacute;') # &#205;
+ para.gsub!(/Î/u, '&Icirc;') # &#206;
+ para.gsub!(/Ï/u, '&Iuml;') # &#207;
+ para.gsub!(/Ð/u, '&ETH;') # &#208;
+ para.gsub!(/Ñ/u, '&Ntilde;') # &#209;
+ para.gsub!(/Ò/u, '&Ograve;') # &#210;
+ para.gsub!(/Ó/u, '&Oacute;') # &#211;
+ para.gsub!(/Ô/u, '&Ocirc;') # &#212;
+ para.gsub!(/Õ/u, '&Otilde;') # &#213;
+ para.gsub!(/Ö/u, '&Ouml;') # &#214;
+ para.gsub!(/Ø/u, '&Oslash;') # &#216;
+ para.gsub!(/Ù/u, '&Ugrave;') # &#217;
+ para.gsub!(/Ú/u, '&Uacute;') # &#218;
+ para.gsub!(/Û/u, '&Ucirc;') # &#219;
+ para.gsub!(/Ü/u, '&Uuml;') # &#220;
+ para.gsub!(/Ý/u, '&Yacute;') # &#221;
+ para.gsub!(/Þ/u, '&THORN;') # &#222;
+ para.gsub!(/ß/u, '&szlig;') # &#223;
+ para.gsub!(/à/u, '&agrave;') # &#224;
+ para.gsub!(/á/u, '&aacute;') # &#225;
+ para.gsub!(/â/u, '&acirc;') # &#226;
+ para.gsub!(/ã/u, '&atilde;') # &#227;
+ para.gsub!(/ä/u, '&auml;') # &#228;
+ para.gsub!(/å/u, '&aring;') # &#229;
+ para.gsub!(/æ/u, '&aelig;') # &#230;
+ para.gsub!(/ç/u, '&ccedil;') # &#231;
+ para.gsub!(/è/u, '&egrave;') # &#232;
+ para.gsub!(/é/u, '&acute;') # &#233;
+ para.gsub!(/ê/u, '&circ;') # &#234;
+ para.gsub!(/ë/u, '&euml;') # &#235;
+ para.gsub!(/ì/u, '&igrave;') # &#236;
+ para.gsub!(/í/u, '&acute;') # &#237;
+ para.gsub!(/î/u, '&icirc;') # &#238;
+ para.gsub!(/ï/u, '&iuml;') # &#239;
+ para.gsub!(/ð/u, '&eth;') # &#240;
+ para.gsub!(/ñ/u, '&ntilde;') # &#241;
+ para.gsub!(/ò/u, '&ograve;') # &#242;
+ para.gsub!(/ó/u, '&oacute;') # &#243;
+ para.gsub!(/ô/u, '&ocirc;') # &#244;
+ para.gsub!(/õ/u, '&otilde;') # &#245;
+ para.gsub!(/ö/u, '&ouml;') # &#246;
+ para.gsub!(/ø/u, '&oslash;') # &#248;
+ para.gsub!(/ù/u, '&ugrave;') # &#250;
+ para.gsub!(/ú/u, '&uacute;') # &#251;
+ para.gsub!(/û/u, '&ucirc;') # &#252;
+ para.gsub!(/ü/u, '&uuml;') # &#253;
+ para.gsub!(/þ/u, '&thorn;') # &#254;
+ para.gsub!(/ÿ/u, '&yuml;') # &#255;
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 =~ /<!Th?¡\s+c/
+ if para =~ /<!Th?¡\s+c/u
@@flag['tables']='y' # KLUDGE get from param
end
para.gsub!(/<:p[bn]>/,'')
@@ -242,7 +242,7 @@ module SiSU_TexInfo
@tex_file=[]
@@tableheader=0
data.each do |para|
- if para =~ /¡|<!T/i
+ if para =~ /¡|<!T/ui
do_mono=TexInfoFormat::Texinfo.new(para,@md)
para=do_mono.longtable # using longtable latex package
end
diff --git a/lib/sisu/v0/texinfo_format.rb b/lib/sisu/v0/texinfo_format.rb
index fbf8dd9a..6564460a 100644
--- a/lib/sisu/v0/texinfo_format.rb
+++ b/lib/sisu/v0/texinfo_format.rb
@@ -374,7 +374,7 @@ WOK
def longtable
@end_table="\\end{longtable}"
@row_break='\\\\\\'
- if @para[/<!Th?¡\s+c(\d+);(.+?)!>/i]
+ if @para[/<!Th?¡\s+c(\d+);(.+?)!>/ui]
no_of_cols,cols_width=$1,$2
@@tableheader=1 if @para =~ /<!Th/i
@w=cols_width.split(/;\s+/)
@@ -389,17 +389,17 @@ WOK
@colW=@colW.join
@@start_table="\\setlength{\\LTleft}{0pt}\n\\setlength{\\LTright}{\\fill}\n" +
"\\begin{longtable}[hb]#@colW\n"
- @para.gsub!(/<!Th?¡\s+c\d+?;.+!>/,"#{@@start_table}")
+ @para.gsub!(/<!Th?¡\s+c\d+?;.+!>/u,"#{@@start_table}")
end
if @para =~/<!TZ!>/
@para.gsub!(/<!TZ!>/," #@end_table")
end
- @para.gsub!(/<!¡/,'')
+ @para.gsub!(/<!¡/u,'')
if @@tableheader==1
- if @para =~/¡\d+?¡(.+?)(?:¡|!)/
+ if @para =~/¡\d+?¡(.+?)(?:¡|!)/u
tablefoot=para[/\<!f(.+?)!\>/,1]
@para.gsub!(/\<!f(.+?)!\>/,'')
- @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[/<!Th?¡\s+c(\d+);(.+?)!>/i]
+ if @para[/<!Th?¡\s+c(\d+);(.+?)!>/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!(/<!Th?¡\s+c\d+?;.+!>/,"#{@@start_table}")
+ @para.gsub!(/<!Th?¡\s+c\d+?;.+!>/u,"#{@@start_table}")
end
if @para =~/<!TZ!>/
@para.gsub!(/<!TZ!>/,"#@end_table")
@@table_pg_break_counter=1
end
- if @para =~/<!¡/
+ if @para =~/<!¡/u
if @@table_pg_break_counter==28 # taken from 34 ideal for portrait to 28 which suits landscape
@para =
"\n\n#@end_table \n" +
@@ -445,14 +445,14 @@ WOK
"#{@@start_table}\n"
@@table_pg_break_counter=1
else
- @para.gsub!(/<!¡/,'')
+ @para.gsub!(/<!¡/u,'')
@@table_pg_break_counter+=1
tablefoot=@para[/\<!f(.+?)!\>/]
@para.gsub!(/\<!f(.+?)!\>/,'')
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 =~/<!Th?¡\s+c/
+ @md.flag_tables=true if para =~/<!Th?¡\s+c/u
do_mono=SiSU_TeX_Pdf::Format_text_object.new(@md,para)
@tex_file << do_mono.special_characters
elsif para.class == Array
para.each do |grp|
- @md.flag_tables=true if grp =~/<!Th?¡\s+c/
+ @md.flag_tables=true if grp =~/<!Th?¡\s+c/u
do_mono=SiSU_TeX_Pdf::Format_text_object.new(@md,grp)
@tex_file << do_mono.special_characters
end
@@ -343,7 +343,7 @@ module SiSU_TeX
@@tableheader={ :p => 0, :l => 0 }
@tex_file=[]
data.each do |para|
- @tex_file << if para =~/¡|<!T/
+ @tex_file << if para =~/¡|<!T/u
tables_hash(@md,para) #Hash result
else para
end
diff --git a/lib/sisu/v0/texpdf_format.rb b/lib/sisu/v0/texpdf_format.rb
index 47b66729..ba84f323 100644
--- a/lib/sisu/v0/texpdf_format.rb
+++ b/lib/sisu/v0/texpdf_format.rb
@@ -287,7 +287,7 @@ WOK
def longtable_landscape
@end_table='\end{longtable}'
@row_break='\\\\\\'
- if @string[/<!Th?¡\s+c(\d+);(.+?)!\\~(\d+;\w\d+;\w\d+)>/]
+ if @string[/<!Th?¡\s+c(\d+);(.+?)!\\~(\d+;\w\d+;\w\d+)>/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!(/<!Th?¡\s+c\d+?;.+!\\~\d+;\w\d+;\w\d+>/,@start_table)
+ @string.gsub!(/<!Th?¡\s+c\d+?;.+!\\~\d+;\w\d+;\w\d+>/u,@start_table)
end
if @string =~/<!TZ!>/
@string.gsub!(/<!TZ!>/," #@end_table\n\\end{tiny}")
end
- @string.gsub!(/<!¡/,'')
+ @string.gsub!(/<!¡/u,'')
if @@tableheader[:l] == 1
- if @string =~/¡\d+?¡(.+?)(?:¡|!)/
+ if @string =~/¡\d+?¡(.+?)(?:¡|!)/u
tablefoot=@string[/\<!f(.+?)!\>/,1]
@string.gsub!(/\<!f(.+?)!\>/,'')
- @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[/<!Th?¡\s+c(\d+);(.+?)!\\~(\d+;\w\d+;\w\d+)>/]
+ if @string[/<!Th?¡\s+c(\d+);(.+?)!\\~(\d+;\w\d+;\w\d+)>/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!(/<!Th?¡\s+c\d+?;.+!\\~\d+;\w\d+;\w\d+>/,"#@start_table")
+ @string.gsub!(/<!Th?¡\s+c\d+?;.+!\\~\d+;\w\d+;\w\d+>/u,"#@start_table")
end
if @string =~/<!TZ!>/
@string.gsub!(/<!TZ!>/," #@end_table\n\\end{tiny}")
end
- @string.gsub!(/<!¡/,'')
+ @string.gsub!(/<!¡/u,'')
if @@tableheader[:p] == 1
- if @string =~/¡\d+?¡(.+?)(?:¡|!)/
+ if @string =~/¡\d+?¡(.+?)(?:¡|!)/u
tablefoot=@string[/\<!f(.+?)!\>/,1]
@string.gsub!(/\<!f(.+?)!\>/,'')
- @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[/<!Th?¡\s+c(\d+);(.+?)!>/]
+ if @string[/<!Th?¡\s+c(\d+);(.+?)!>/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!(/<!Th?¡\s+c\d+?;.+!>/,"#@start_table}")
+ @string.gsub!(/<!Th?¡\s+c\d+?;.+!>/u,"#@start_table}")
end
if @string =~/<!TZ!>/
@string.gsub!(/<!TZ!>/,"#@end_table")
@@table_pg_break_counter=1
end
- if @string =~/<!¡/
+ if @string =~/<!¡/u
if @@table_pg_break_counter == 28 # taken from 34 ideal for portrait to 28 which suits landscape
@string="\n\n#@end_table \n#@break_page#@start_table\n"
@@table_pg_break_counter=1
else
- @string.gsub!(/<!¡/,'')
+ @string.gsub!(/<!¡/u,'')
@@table_pg_break_counter+=1
tablefoot=@string[/\<!f(.+?)!\>/,1]
@string.gsub!(/\<!f(.+?)!\>/,'')
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~|%+ |<!Th?¡ )/m
+ unless para =~/^(?:0~|%+ |<!Th?¡ )/um
w.gsub!(/[\\]?~/,'<=tilde>') 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!(/<a href=".+?">/,' ')
@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!(/<!Th?¡.+/m,"#@br#{table_message}")
+ para.gsub!(/<!Th?¡.+/um,"#@br#{table_message}")
para.gsub!(/.+?<-#>/,'') # remove dummy headings (used by html) #check
para.gsub!(/_\*\s+/,'* ') # bullet markup, marked down
para.gsub!(/&#169;/,'©') # bullet markup, marked down
@@ -334,7 +334,7 @@ WOK
#formatMono=MonoSiSU.new('<br /><a name="owner.details">Owner Details</a>')
#@@wiki[:owner_details]=formatMono.bold_para
#para=''
- elsif para =~/(¡|<!Th?)/ #tables !
+ elsif para =~/(¡|<!Th?)/u #tables !
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[/<!f(.+?)!>/,1]
@@tablefoot << m if m
@parablock.gsub!(/<!f.+?!>/,'')
- @@tablehead=1 if @parablock =~/<!Th¡/
- if @parablock =~/<!Th?¡/
- @parablock.gsub!(/<!Th?¡.+?!~(\d+);\w\d+;\w\d+>/,
+ @@tablehead=1 if @parablock =~/<!Th¡/u
+ if @parablock =~/<!Th?¡/u
+ @parablock.gsub!(/<!Th?¡.+?!~(\d+);\w\d+;\w\d+>/u,
%{\n<ocn>#@ocn</ocn><table summary="normal text css" width="100%" border="0" bgcolor="white" cellpadding="2" align="center">})
end
if @parablock =~/<!TZ!>/
@@ -101,12 +101,12 @@ module SiSU_Tables
@parablock.gsub!(/<!TZ!>\s*/,"</table>\n")
end
if @@tablehead == 1
- if @parablock =~/¡¡/
- @parablock.gsub!(/<!¡¡(\d+?)¡/,
+ if @parablock =~/¡¡/u
+ @parablock.gsub!(/<!¡¡(\d+?)¡/u,
%{<tr>
<td width="\\1%" valign="top">
#{@vz.paragraph_table_xml}<b>})
- @parablock.gsub!(/¡¡(\d+?)¡/,
+ @parablock.gsub!(/¡¡(\d+?)¡/u,
%{</b></td><td width="\\1%" valign="top">
#{@vz.paragraph_table_xml}<b>})
@parablock.gsub!(/!>/,"</b>\n</td>\n</tr>")
@@ -114,11 +114,11 @@ module SiSU_Tables
end
@parablock
else
- @parablock.gsub!(/<!¡¡(\d+?)¡/,
+ @parablock.gsub!(/<!¡¡(\d+?)¡/u,
%{<tr>
<td width="\\1%" valign="top">
#{@vz.paragraph_table_xml}})
- @parablock.gsub!(/¡¡(\d+?)¡/,
+ @parablock.gsub!(/¡¡(\d+?)¡/u,
%{
</td>
<td width="\\1%" valign="top">
@@ -170,8 +170,8 @@ module SiSU_Tables
m=@parablock[/<!f(.+?)!>/,1]
@@tablefoot << m if m
@parablock.gsub!(/<!f.+?!>/,'')
- @@tablehead=1 if @parablock =~/<!Th¡/
- if @parablock =~/<!Th?¡.+?!~(\d+);\w\d+;\w\d+>/; @parablock=table_head($1)
+ @@tablehead=1 if @parablock =~/<!Th¡/u
+ if @parablock =~/<!Th?¡.+?!~(\d+);\w\d+;\w\d+>/u; @parablock=table_head($1)
end
if @parablock =~/<!TZ!>/
tablefoot=[]
@@ -181,12 +181,12 @@ module SiSU_Tables
end
end
if @@tablehead == 1
- if @parablock =~/¡¡/
- if @parablock =~/<!¡¡(\d+?)¡/
- @parablock.gsub!(/<!¡¡(\d+?)¡/,table_row($1,true))
+ if @parablock =~/¡¡/u
+ if @parablock =~/<!¡¡(\d+?)¡/u
+ @parablock.gsub!(/<!¡¡(\d+?)¡/u,table_row($1,true))
end
- if @parablock =~/¡¡(\d+?)¡/
- @parablock.gsub!(/¡¡(\d+?)¡/,table_cell($1,true))
+ if @parablock =~/¡¡(\d+?)¡/u
+ @parablock.gsub!(/¡¡(\d+?)¡/u,table_cell($1,true))
end
if @parablock =~/!>/
@parablock.gsub!(/!>/,table_row_close(true))
@@ -195,11 +195,11 @@ module SiSU_Tables
end
@parablock
else
- if @parablock =~/<!¡¡(\d+?)¡/
- @parablock.gsub!(/<!¡¡(\d+?)¡/,table_row($1))
+ if @parablock =~/<!¡¡(\d+?)¡/u
+ @parablock.gsub!(/<!¡¡(\d+?)¡/u,table_row($1))
end
- if @parablock =~/¡¡(\d+?)¡/
- @parablock.gsub!(/¡¡(\d+?)¡/,table_cell($1))
+ if @parablock =~/¡¡(\d+?)¡/u
+ @parablock.gsub!(/¡¡(\d+?)¡/u,table_cell($1))
end
if @parablock =~/!>/
@parablock.gsub!(/!>/,table_row_close)