aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3dv/texinfo_format.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v3dv/texinfo_format.rb')
-rw-r--r--lib/sisu/v3dv/texinfo_format.rb212
1 files changed, 104 insertions, 108 deletions
diff --git a/lib/sisu/v3dv/texinfo_format.rb b/lib/sisu/v3dv/texinfo_format.rb
index fc7ffde2..30d40e20 100644
--- a/lib/sisu/v3dv/texinfo_format.rb
+++ b/lib/sisu/v3dv/texinfo_format.rb
@@ -81,20 +81,20 @@ module SiSU_TexInfoFormat
year=t.year
filename=%{#{@md.fns}}[/(.+?)\.\w\w\d\d$/,1]
title=spec_char(@md.title.full)
- title=title.gsub(/<(br|p|i)>|<\/\s*(br|p|i)>|<(br|p)\s*\/>/," #{Tex[:backslash]*2} ")
- title.gsub!(/\$/,"\\$")
- title.gsub!(/[,]\s*/,' - ')
+ title=title.gsub(/<(br|p|i)>|<\/\s*(br|p|i)>|<(br|p)\s*\/>/," #{Tex[:backslash]*2} ").
+ gsub(/\$/,"\\$").
+ gsub(/[,]\s*/,' - ')
if @md.title.sub
subtitle=spec_char(@md.title.sub)
- subtitle=subtitle.gsub(/<(br|p|i)>|<\/\s*(br|p|i)>|<(br|p)\s*\/>/," #{Tex[:backslash]*2} ")
- subtitle.gsub!(/\$/,"\\$")
- subtitle.gsub!(/[,]\s*/,' - ')
+ subtitle=subtitle.gsub(/<(br|p|i)>|<\/\s*(br|p|i)>|<(br|p)\s*\/>/," #{Tex[:backslash]*2} ").
+ gsub(/\$/,"\\$").
+ gsub(/[,]\s*/,' - ')
subtitle="@subtitle @value{VERSION}, @value{UPDATED}\n" #bugwatch
end
subtitle ||=''
author=@md.author if @md.author
author ||=''
- author.gsub!(/[\*]/,'') #if author
+ author=author.gsub(/[\*]/,'') #if author
v=SiSU_Env::InfoVersion.instance.get_version
head =<<WOK
\\input texinfo @c -*-texinfo-*-
@@ -151,9 +151,9 @@ WOK
end
def topnode(txt)
txt=spec_char(txt)
- txt=txt.gsub(/<(br|p|i)>|<\/\s*(br|p|i)>|<(br|p)\s*\/>/," #{Tex[:backslash]*2} ")
- txt.gsub!(/\$/,"\\$")
- txt.gsub!(/[,]\s*/,' - ')
+ txt=txt.gsub(/<(br|p|i)>|<\/\s*(br|p|i)>|<(br|p)\s*\/>/," #{Tex[:backslash]*2} ").
+ gsub(/\$/,"\\$").
+ gsub(/[,]\s*/,' - ')
"@c %% 4\n" +
"@ifnottex\n" +
"@node Top\n" +
@@ -298,15 +298,14 @@ WOK
and dob.obj !~/##{dob.ocn}/
dob.obj="#{dob.obj} ##{dob.ocn}"
end
- dob.obj.gsub!(/<:#>/,'')
- dob.obj.strip!
+ dob.obj=dob.obj.gsub(/<:#>/,'').strip
dob
end
def menu
dob=clean(@dob)
m=dob.obj
- m.gsub!(/[:,]\s*/,' - ')
- m.gsub!(/@footnote\{.+?\}\s+/,'')
+ m=m.gsub(/[:,]\s*/,' - ').
+ gsub(/@footnote\{.+?\}\s+/,'')
m="* #{m}::"
end
def level1
@@ -347,80 +346,79 @@ WOK
end
def submenu
@dob.obj=@dob.obj.join("\n")
- @dob.obj.gsub!(/[5]\\+~\S+/,'')
+ @dob.obj=@dob.obj.gsub(/[5]\\+~\S+/,'')
dob=clean(@dob)
dob.obj="@menu\n#{dob.obj}\n@end menu\n\n"
- dob.obj.gsub!(/.+/m,"#{dob.obj}")
+ dob.obj=dob.obj.gsub(/.+/m,"#{dob.obj}")
end
def subsubmenu
@dob.obj=@dob.obj.join("\n")
- @dob.obj.gsub!(/[6]\\+~\S+/,'')
+ @dob.obj=@dob.obj.gsub(/[6]\\+~\S+/,'')
dob=clean(@dob)
dob.obj="@menu\n#{dob.obj}\n@end menu\n\n"
- dob.obj.gsub!(/.+/m,"#{dob.obj}")
+ dob.obj=dob.obj.gsub(/.+/m,"#{dob.obj}")
end
def indent1
- @dob.obj.gsub!(/<:i1>(.*)/,'\1')
+ @dob.obj=@dob.obj.gsub(/<:i1>(.*)/,'\1')
end
def indent2
- @dob.obj.gsub!(/<:i2>(.*)/,'\1')
+ @dob.obj=@dob.obj.gsub(/<:i2>(.*)/,'\1')
end
def spec_char(txt) # special characters
- txt.gsub!(/#{Mx[:br_eof]}/i,'')
- txt.gsub!(/#{Mx[:gl_o]}#169#{Mx[:gl_c]}/,'(c)')
- txt.gsub!(/#{Mx[:gl_o]}#(?:lt|060)#{Mx[:gl_c]}/,'<'); txt.gsub!(/#{Mx[:gl_o]}(gt|#062)#{Mx[:gl_c]}/,'>')
- txt.gsub!(/#{Mx[:gl_o]}#123#{Mx[:gl_c]}/,'{'); txt.gsub!(/#{Mx[:gl_o]}#125#{Mx[:gl_c]}/,'}')
- txt.gsub!(/#{Mx[:gl_o]}#(?:126|152)#{Mx[:gl_c]}/i,'~')
- txt.gsub!(/#{Mx[:gl_o]}#033#{Mx[:gl_c]}/,'!')
- txt.gsub!(/#{Mx[:gl_o]}#035#{Mx[:gl_c]}/,'#')
- txt.gsub!(/#{Mx[:gl_o]}#042#{Mx[:gl_c]}/,'*')
- txt.gsub!(/#{Mx[:gl_o]}#047#{Mx[:gl_c]}/,'/')
- txt.gsub!(/#{Mx[:gl_o]}#095#{Mx[:gl_c]}/,'_')
- txt.gsub!(/#{Mx[:gl_o]}#092#{Mx[:gl_c]}/,'\\')
- txt.gsub!(/(?:#{Mx[:br_line]}|#{Mx[:br_nl]})\s*/,"\n\n") # watch
- txt.gsub!(/<sup><font face=symbol>&atild;<\/font><\/sup>/,' ')
- #txt.gsub!(/\\/,'\\backslash ')
- txt.gsub!(/<:pb>/,'\\newpage')
- txt.gsub!(/\\backslash copyright/,'\\copyright ')
- txt.gsub!(/\^/,'\\wedge ')
- txt.gsub!(/(\$)/,"\\$")
- txt.gsub!(/\~/,'\\~')
- txt.gsub!(/#{Mx[:url_o]}(https?:\S+?)#{Mx[:url_c]}/,'<\1>')
- txt.gsub!(/#{Mx[:url_o]}_(https?:\S+?)#{Mx[:url_c]}/,'\1')
- txt.gsub!(/§/i,'\S')
- txt.gsub!(/£/i,'\pounds')
- txt.gsub!(/å/,'\aa'); txt.gsub!(/Å/,'\AA')
- txt.gsub!(/æ/,'\ae'); txt.gsub!(/Æ/,'\AE')
- txt.gsub!(/ø/,'\o'); txt.gsub!(/Ø/,'\O')
- txt.gsub!(/<a href=".+?">/i,' ')
- txt.gsub!(/<\/a>/i,' ')
- txt.gsub!(/<!>/i,' ')
- txt.gsub!(/#{Mx[:br_paragrph]}/i,'') #watch
- txt.gsub!(/#{Mx[:fa_bold_o]}(.+?)#{Mx[:fa_bold_c]}/,'*\1*')
- txt.gsub!(/#{Mx[:fa_italics_o]}(.+?)#{Mx[:fa_italics_c]}/,'/\1/')
- txt.gsub!(/#{Mx[:fa_underscore_o]}(.+?)#{Mx[:fa_underscore_c]}/,'_\1_')
- txt.gsub!(/#{Mx[:fa_subscript_o]}(.+?)#{Mx[:fa_subscript_c]}/,'[\1]')
- txt.gsub!(/#{Mx[:fa_superscript_o]}(.+?)#{Mx[:fa_superscript_c]}/,'^\1^')
- txt.gsub!(/#{Mx[:fa_insert_o]}(.+?)#{Mx[:fa_insert_c]}/,'+\1+')
- txt.gsub!(/#{Mx[:fa_cite_o]}(.+?)#{Mx[:fa_cite_c]}/,'"\1"')
- txt.gsub!(/#{Mx[:fa_strike_o]}(.+?)#{Mx[:fa_strike_c]}/,'-\1-')
- txt.gsub!(/@/i,'@@')
- txt.gsub!(/\{/,'@{'); txt.gsub!(/\}/,'@}')
- txt.gsub!(/(?:&nbsp;|#{Mx[:nbsp]})+/,' ') # ~ character for hardspace
- txt.gsub!(/&(\S+?);/,' ')
- txt.gsub!(/&/,'<=and>')
- txt.gsub!(/(\s+&\s+)/,' and ')
- txt.gsub!(/(\&)/,"\\&")
- txt.gsub!(/"(.+?)"/,"`\\1'") # open & close "
- txt.gsub!(/\s+"/," `") # open "
- txt.gsub!(/^([1-6-]\\+(?:~\S+)?|<.+?>)?\s*"/,'\1`') # open "
- txt.gsub!(/"(\s|\.|,|:|;)/,"'\\1") # close "
- txt.gsub!(/"([1-6-]\\+(?:~\S+)?|<.+?>)?\s*$/,"'\\1") # close "
- txt.gsub!(/"(\.|,)/,"'") # close "
- txt.gsub!(/\s+'/," `") # open '
- txt.gsub!(/^([1-6-]\\+(?:~\S+)?|<.+?>)?\s*'/,'\1`') # open '
- txt.gsub!(/(<font.*?>|<\/font>)/,'')
- txt
+ txt=txt.gsub(/#{Mx[:br_eof]}/i,'').
+ gsub(/#{Mx[:gl_o]}#169#{Mx[:gl_c]}/,'(c)').
+ gsub(/#{Mx[:gl_o]}#(?:lt|060)#{Mx[:gl_c]}/,'<').gsub(/#{Mx[:gl_o]}(gt|#062)#{Mx[:gl_c]}/,'>').
+ gsub(/#{Mx[:gl_o]}#123#{Mx[:gl_c]}/,'{').gsub(/#{Mx[:gl_o]}#125#{Mx[:gl_c]}/,'}').
+ gsub(/#{Mx[:gl_o]}#(?:126|152)#{Mx[:gl_c]}/i,'~').
+ gsub(/#{Mx[:gl_o]}#033#{Mx[:gl_c]}/,'!').
+ gsub(/#{Mx[:gl_o]}#035#{Mx[:gl_c]}/,'#').
+ gsub(/#{Mx[:gl_o]}#042#{Mx[:gl_c]}/,'*').
+ gsub(/#{Mx[:gl_o]}#047#{Mx[:gl_c]}/,'/').
+ gsub(/#{Mx[:gl_o]}#095#{Mx[:gl_c]}/,'_').
+ gsub(/#{Mx[:gl_o]}#092#{Mx[:gl_c]}/,'\\').
+ gsub(/(?:#{Mx[:br_line]}|#{Mx[:br_nl]})\s*/,"\n\n"). # watch
+ gsub(/<sup><font face=symbol>&atild;<\/font><\/sup>/,' ').
+ #gsub(/\\/,'\\backslash ').
+ gsub(/<:pb>/,'\\newpage').
+ gsub(/\\backslash copyright/,'\\copyright ').
+ gsub(/\^/,'\\wedge ').
+ gsub(/(\$)/,"\\$").
+ gsub(/\~/,'\\~').
+ gsub(/#{Mx[:url_o]}(https?:\S+?)#{Mx[:url_c]}/,'<\1>').
+ gsub(/#{Mx[:url_o]}_(https?:\S+?)#{Mx[:url_c]}/,'\1').
+ gsub(/§/i,'\S').
+ gsub(/£/i,'\pounds').
+ gsub(/å/,'\aa').gsub(/Å/,'\AA').
+ gsub(/æ/,'\ae').gsub(/Æ/,'\AE').
+ gsub(/ø/,'\o').gsub(/Ø/,'\O').
+ gsub(/<a href=".+?">/i,' ').
+ gsub(/<\/a>/i,' ').
+ gsub(/<!>/i,' ').
+ gsub(/#{Mx[:br_paragrph]}/i,''). #watch
+ gsub(/#{Mx[:fa_bold_o]}(.+?)#{Mx[:fa_bold_c]}/,'*\1*').
+ gsub(/#{Mx[:fa_italics_o]}(.+?)#{Mx[:fa_italics_c]}/,'/\1/').
+ gsub(/#{Mx[:fa_underscore_o]}(.+?)#{Mx[:fa_underscore_c]}/,'_\1_').
+ gsub(/#{Mx[:fa_subscript_o]}(.+?)#{Mx[:fa_subscript_c]}/,'[\1]').
+ gsub(/#{Mx[:fa_superscript_o]}(.+?)#{Mx[:fa_superscript_c]}/,'^\1^').
+ gsub(/#{Mx[:fa_insert_o]}(.+?)#{Mx[:fa_insert_c]}/,'+\1+').
+ gsub(/#{Mx[:fa_cite_o]}(.+?)#{Mx[:fa_cite_c]}/,'"\1"').
+ gsub(/#{Mx[:fa_strike_o]}(.+?)#{Mx[:fa_strike_c]}/,'-\1-').
+ gsub(/@/i,'@@').
+ gsub(/\{/,'@{').gsub(/\}/,'@}').
+ gsub(/(?:&nbsp;|#{Mx[:nbsp]})+/,' '). # ~ character for hardspace
+ gsub(/&(\S+?);/,' ').
+ gsub(/&/,'<=and>').
+ gsub(/(\s+&\s+)/,' and ').
+ gsub(/(\&)/,"\\&").
+ gsub(/"(.+?)"/,"`\\1'"). # open & close "
+ gsub(/\s+"/," `"). # open "
+ gsub(/^([1-6-]\\+(?:~\S+)?|<.+?>)?\s*"/,'\1`'). # open "
+ gsub(/"(\s|\.|,|:|;)/,"'\\1"). # close "
+ gsub(/"([1-6-]\\+(?:~\S+)?|<.+?>)?\s*$/,"'\\1"). # close "
+ gsub(/"(\.|,)/,"'"). # close "
+ gsub(/\s+'/," `"). # open '
+ gsub(/^([1-6-]\\+(?:~\S+)?|<.+?>)?\s*'/,'\1`'). # open '
+ gsub(/(<font.*?>|<\/font>)/,'')
end
def longtable
@end_table="\\end{longtable}"
@@ -440,28 +438,28 @@ WOK
@colW=@colW.join
@@start_table="\\setlength{\\LTleft}{0pt}\n\\setlength{\\LTright}{\\fill}\n" +
"\\begin{longtable}[hb]#{@colW}\n"
- @dob.obj.gsub!(/#{Mx[:gr_o]}Th?#{Mx[:tc_p]}\s+c\d+?;.+#{Mx[:gr_c]}/u,"#{@@start_table}") #fix
+ @dob.obj=@dob.obj.gsub(/#{Mx[:gr_o]}Th?#{Mx[:tc_p]}\s+c\d+?;.+#{Mx[:gr_c]}/u,"#{@@start_table}") #fix
end
if @dob =~/#{Mx[:gr_o]}TZ#{Mx[:gr_c]}/ #fix
- @dob.obj.gsub!(/#{Mx[:gr_o]}TZ#{Mx[:gr_c]}/," #{@end_table}") #fix
+ @dob.obj=@dob.obj.gsub(/#{Mx[:gr_o]}TZ#{Mx[:gr_c]}/," #{@end_table}") #fix
end
- @dob.obj.gsub!(/#{Mx[:tc_o]}#{Mx[:tc_p]}/u,'')
+ @dob.obj=@dob.obj.gsub(/#{Mx[:tc_o]}#{Mx[:tc_p]}/u,'')
if @@tableheader==1
if @dob =~/#{Mx[:tc_p]}\d+?#{Mx[:tc_p]}(.+?)(?:#{Mx[:tc_p]}|!)/u
tablefoot=para[/\<!f(.+?)!\>/,1]
- @dob.obj.gsub!(/\<!f(.+?)!\>/,'')
- @dob.obj.gsub!(/#{Mx[:tc_p]}\d+?#{Mx[:tc_p]}(.+?)(?:#{Mx[:tc_p]}|!)/u,
- "{\\begin{tiny} {\\bfseries \\1}\\end{tiny}}&")
- @dob.obj.gsub!(/&>\s*$/,
- " #{@row_break} \\hline\\endhead #{@row_break}")
+ @dob.obj=@dob.obj.gsub(/\<!f(.+?)!\>/,'').
+ gsub(/#{Mx[:tc_p]}\d+?#{Mx[:tc_p]}(.+?)(?:#{Mx[:tc_p]}|!)/u,
+ "{\\begin{tiny} {\\bfseries \\1}\\end{tiny}}&").
+ gsub(/&>\s*$/,
+ " #{@row_break} \\hline\\endhead #{@row_break}")
@dob="#{@dob} \\multicolumn{#{@@number_of_cols}}{l}{\\tiny #{tablefoot}} \\\\ \\hline\n\\endfoot\n\\hline\n" if tablefoot
@@tableheader=0
@@number_of_cols=0
end
else
if @dob =~/#{Mx[:tc_p]}\d+?#{Mx[:tc_p]}(.+?)(?:#{Mx[:tc_p]}|!)/u
- @dob.obj.gsub!(/#{Mx[:tc_p]}\d+?#{Mx[:tc_p]}(.+?)(?:#{Mx[:tc_p]}|!)/u,"\\begin{tiny}\\1\\end{tiny}&")
- @dob.obj.gsub!(/&>\s*$/," #{@row_break}")
+ @dob.obj=@dob.obj.gsub(/#{Mx[:tc_p]}\d+?#{Mx[:tc_p]}(.+?)(?:#{Mx[:tc_p]}|!)/u,"\\begin{tiny}\\1\\end{tiny}&").
+ gsub(/&>\s*$/," #{@row_break}")
end
end
@dob
@@ -482,10 +480,10 @@ WOK
@colW << "p{#{col_w}cm}" if col_w
end
@@start_table="\\begin{tabular}{#{@colW}}\n"
- @dob.obj.gsub!(/#{Mx[:gr_o]}Th?#{Mx[:tc_p]}\s+c\d+?;.+#{Mx[:gr_c]}/u,"#{@@start_table}") #fix
+ @dob.obj=@dob.obj.gsub(/#{Mx[:gr_o]}Th?#{Mx[:tc_p]}\s+c\d+?;.+#{Mx[:gr_c]}/u,"#{@@start_table}") #fix
end
if @dob =~/#{Mx[:gr_o]}TZ#{Mx[:gr_c]}/ #fix
- @dob.obj.gsub!(/#{Mx[:gr_o]}TZ#{Mx[:gr_c]}/,"#{@end_table}") #fix
+ @dob.obj=@dob.obj.gsub(/#{Mx[:gr_o]}TZ#{Mx[:gr_c]}/,"#{@end_table}") #fix
@@table_pg_break_counter=1
end
if @dob =~/#{Mx[:tc_o]}#{Mx[:tc_p]}/u
@@ -496,21 +494,21 @@ WOK
"#{@@start_table}\n"
@@table_pg_break_counter=1
else
- @dob.obj.gsub!(/#{Mx[:tc_o]}#{Mx[:tc_p]}/u,'')
+ @dob.obj=@dob.obj.gsub(/#{Mx[:tc_o]}#{Mx[:tc_p]}/u,'')
@@table_pg_break_counter+=1
tablefoot=@dob[/\<!f(.+?)!\>/]
- @dob.obj.gsub!(/\<!f(.+?)!\>/,'')
+ @dob.obj=@dob.obj.gsub(/\<!f(.+?)!\>/,'')
end
end
if @dob =~/#{Mx[:tc_p]}\d+?#{Mx[:tc_p]}(.+?)(?:#{Mx[:tc_p]}|!)/u
- @dob.obj.gsub!(/#{Mx[:tc_p]}\d+?#{Mx[:tc_p]}(.+?)(?:#{Mx[:tc_p]}|!)/u,"\\begin{tiny}\\1\\end{tiny}&")
- @dob.obj.gsub!(/&>\s*$/,"#{@row_break}")
+ @dob.obj=@dob.obj.gsub(/#{Mx[:tc_p]}\d+?#{Mx[:tc_p]}(.+?)(?:#{Mx[:tc_p]}|!)/u,"\\begin{tiny}\\1\\end{tiny}&").
+ gsub(/&>\s*$/,"#{@row_break}")
end
@dob
end
def graphics
dir=SiSU_Env::InfoEnv.new(@md.fns)
- @dob.obj.gsub!(/<::\s+(\S+?)\s+>/i, #watch
+ @dob.obj=@dob.obj.gsub(/<::\s+(\S+?)\s+>/i, #watch
"\\includegraphics*[width=11pt]{#{dir.path.image_source_include}/c_\\1.png}")
end
def image
@@ -518,17 +516,17 @@ WOK
width="100"
width=@dob[/<:image.+?width=``(\d+)''.+?>/im,1]
width=width.to_i*0.4
- @dob.obj.gsub!(/<:image\s+((?:https?|file|ftp)\S+)\s+(\S+)\s+.+\s+?>/i,
- "\\href{\\1}{\\includegraphics*[width=#{width}pt]{#{dir.path.image_source_include}/\\2}}")
- @dob.obj.gsub!(/<:image\s+(\S+)\s+.+\s+?>/i,
- "\\includegraphics*[width=#{width}pt]{#{dir.path.image_source_include}/\\1}")
+ @dob.obj=@dob.obj.gsub(/<:image\s+((?:https?|file|ftp)\S+)\s+(\S+)\s+.+\s+?>/i,
+ "\\href{\\1}{\\includegraphics*[width=#{width}pt]{#{dir.path.image_source_include}/\\2}}").
+ gsub(/<:image\s+(\S+)\s+.+\s+?>/i,
+ "\\includegraphics*[width=#{width}pt]{#{dir.path.image_source_include}/\\1}")
end
def png
# very messy clean up ! - work area, testing
z=@dob[/\\\{(.+?)\}(?:image|png)/,1] # match operator for z \\ fragile !
image,w,x,y=z.scan(/\S+/)
- image.gsub!(/\\/,'')
- @dob.obj.gsub!(/\\\{\S+\.(png|jpg|gif).+?\}(image|png)/,"<image #{image} not available>") # fragile match operator\\ fragile !
+ image=image.gsub(/\\/,'')
+ @dob.obj=@dob.obj.gsub(/\\\{\S+\.(png|jpg|gif).+?\}(image|png)/,"<image #{image} not available>") # fragile match operator\\ fragile !
end
def http
# very messy clean up ! - work area, testing
@@ -536,7 +534,7 @@ WOK
url=@dob[/((?:https?|file|ftp):\S+)/im,1]
if @dob =~/\.(png|jpg|gif)/
image,w,x,y=z.scan(/\S+/)
- image.gsub!(/\\/,'')
+ image=image.gsub(/\\/,'')
width=200
width=z[/w=(\d+)/im,1] if z =~/w=(\d+)/
width=width.to_i*0.8
@@ -546,11 +544,11 @@ WOK
end
if image
dir=SiSU_Env::InfoEnv.new(@md.fns)
- @dob.obj.gsub!(/#{Mx[:lnk_o]}\S+\.(png|jpg|gif).+?#{Mx[:lnk_c]}#{Mx[:url_o]}\S+?#{Mx[:url_c]}/, # fragile match operator\\ fragile !
+ @dob.obj=@dob.obj.gsub(/#{Mx[:lnk_o]}\S+\.(png|jpg|gif).+?#{Mx[:lnk_c]}#{Mx[:url_o]}\S+?#{Mx[:url_c]}/, # fragile match operator\\ fragile !
"\n\\href{#{url}}{\\includegraphics*[width=#{width}pt]{#{dir.path.image_source_include}/#{image}}}#{caption}")
else
link=z[/(.+?)\\/im,1]
- @dob.obj.gsub!(/#{Mx[:lnk_o]}.+?#{Mx[:lnk_c]}#{Mx[:url_o]}\S+#{Mx[:url_c]}/,"\n\\noindent\\href{#{url}}{#{link}}") # fragile match operator\\ fragile !
+ @dob.obj=@dob.obj.gsub(/#{Mx[:lnk_o]}.+?#{Mx[:lnk_c]}#{Mx[:url_o]}\S+#{Mx[:url_c]}/,"\n\\noindent\\href{#{url}}{#{link}}") # fragile match operator\\ fragile !
end
end
end
@@ -563,23 +561,21 @@ WOK
and txt !~/##{dob.ocn}/
txt="#{dob.obj} ##{dob.ocn}"
end
- txt.gsub!(/<:#>/,'')
- txt.strip!
- txt
+ txt=txt.gsub(/<:#>/,'').strip
end
def submenu
txt=@txt.join("\n")
- txt.gsub!(/[5]\\+~\S+/,'')
+ txt=txt.gsub(/[5]\\+~\S+/,'')
txt=clean(@dob,txt)
txt="@menu\n#{txt}\n@end menu\n\n"
- txt.gsub!(/.+/m,"#{txt}")
+ txt=txt.gsub(/.+/m,"#{txt}")
end
def subsubmenu
txt=@txt.join("\n")
- txt.gsub!(/[6]\\+~\S+/,'')
+ txt=txt.gsub(/[6]\\+~\S+/,'')
txt=clean(@dob,txt)
txt="@menu\n#{dob.obj}\n@end menu\n\n"
- txt.gsub!(/.+/m,"#{txt}")
+ txt=txt.gsub(/.+/m,"#{txt}")
end
end
end