diff options
author | Ralph Amissah <ralph@amissah.com> | 2008-07-22 20:00:59 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2008-07-22 20:00:59 -0400 |
commit | d29a3e5469d8468084641c385ebf16948f7c2437 (patch) | |
tree | 1a2306de3c5c1055dbc0374b95f31c335f5da85c /lib/sisu/v0/shared_txt.rb | |
parent | action response query fix (diff) |
sisu-0.68.0 proposed
* middle layer document representation changed, (accounting for substantial patch)
* texpdf multiple document sizes as specified in config
* numerous small fixes
[should on the whole be easier to maintain]
Diffstat (limited to 'lib/sisu/v0/shared_txt.rb')
-rw-r--r-- | lib/sisu/v0/shared_txt.rb | 180 |
1 files changed, 63 insertions, 117 deletions
diff --git a/lib/sisu/v0/shared_txt.rb b/lib/sisu/v0/shared_txt.rb index aaa2d4d7..484a5f05 100644 --- a/lib/sisu/v0/shared_txt.rb +++ b/lib/sisu/v0/shared_txt.rb @@ -74,7 +74,7 @@ module SiSU_text_utils line=0 out=[] out[line]='' - @para.gsub!(/<:br>/,"\n\n") + @para.gsub!(/#{Mx[:br_nl]}/,"\n\n") words=@para.scan(/\n\n|\S+/m) while words != '' word=words.shift @@ -116,7 +116,7 @@ module SiSU_text_utils end class Header_scan def initialize(md,para) - @regxcl=/<~\d+;\w\d+;\w\d+><(?:[0-9a-f]{32}|[0-9a-f]{64}):(?:[0-9a-f]{32}|[0-9a-f]{64})>/ + @regxcl=/#{Mx[:id_o]}~\d+;\w\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}(?:[0-9a-f]{32}|[0-9a-f]{64}):(?:[0-9a-f]{32}|[0-9a-f]{64})#{Mx[:id_c]}/ para=para.gsub(@regxcl,'').dup @md,@p=md,para end @@ -155,122 +155,68 @@ module SiSU_text_utils end self end - def start_is_zero + def start_is_match meta=case @p - when /^0~(title)\s+(.+?)$/; header($1,@md.dc_title,'meta','dc') #dc 1 - #when /^0~(subtitle)\s+(.+?)$/; header($1,$2) - when /^0~(creator|author)\s+(.+?)$/; header('creator',$2,'meta','dc') #dc 2 - when /^0~(subject)\s+(.+?)$/; header($1,$2,'meta','dc') #dc 3 - when /^0~(description)\s+(.+?)$/; header($1,$2,'meta','dc') #dc 4 - when /^0~(publisher)\s+(.+?)$/; header($1,$2,'meta','dc') #dc 5 - when /^0~(contributor)\s+(.+?)$/; header($1,$2,'meta','dc') #dc 6 - when /^0~(date)\s+(.+?)$/; header($1,$2,'meta','dc') #dc 7 - when /^0~(date\.created)\s+(.+?)$/; header($1,$2,'meta','extra') - when /^0~(date\.issued)\s+(.+?)$/; header($1,$2,'meta','extra') - when /^0~(date\.available)\s+(.+?)$/; header($1,$2,'meta','extra') - when /^0~(date\.valid)\s+(.+?)$/; header($1,$2,'meta','extra') - when /^0~(date\.modified)\s+(.+?)$/; header($1,$2,'meta','extra') - when /^0~(type)\s+(.+?)$/; header($1,$2,'meta','dc') #dc 8 - when /^0~(format)\s+(.+?)$/; header($1,$2,'meta','dc') #dc 9 - when /^0~(identifier)\s+(.+?)$/; header($1,$2,'meta','dc') #dc 10 - when /^0~(source)\s+(.+?)$/; header($1,$2,'meta','dc') #dc 11 - when /^0~(language)\s+(.+?)$/; header($1,$2,'meta','dc') #dc 12 - when /^0~(relation)\s+(.+?)$/; header($1,$2,'meta','dc') #dc 13 - when /^0~(coverage)\s+(.+?)$/; header($1,$2,'meta','dc') #dc 14 - when /^0~(rights)\s+(.+?)$/; header($1,$2,'meta','dc') #dc 15 - when /^0~(keywords)\s+(.+?)$/; header($1,$2,'meta','extra') - when /^0~(copyright)\s+(.+?)$/; header($1,$2,'meta','extra') - when /^0~(translator|translated_by)\s+(.+?)$/; header('translator',$2,'meta','extra') - when /^0~(illustrator|illustrated_by)\s+(.+?)$/; header('illustrator',$2,'meta','extra') - when /^0~(prepared_by)\s+(.+?)$/; header($1,$2,'meta','extra') - when /^0~(digitized_by)\s+(.+?)$/; header($1,$2,'meta','extra') - when /^0~(comments?)\s+(.+?)$/; header($1,$2,'meta','extra') - when /^0~(abstract)\s+(.+?)$/; header($1,$2,'meta','extra') - when /^0~(tags?)\s+(.+?)$/; header($1,$2,'meta','extra') - when /^0~(catalogue)\s+(.+?)$/; header($1,$2,'meta','extra') - when /^0~(class(?:ify)?_loc)\s+(.+?)$/; header('classify_loc',$2,'meta','extra') - when /^0~(class(?:ify)?_dewey)\s+(.+?)$/; header('classify_dewey',$2,'meta','extra') - when /^0~(class(?:ify)?_pg)\s+(.+?)$/; header('classify_pg',$2,'meta','extra') - when /^0~(class(?:ify)?_isbn)\s+(.+?)$/; header('classify_isbn',$2,'meta','extra') - when /^0~(toc|structure)\s+(.+?)$/; header('structure',$2,'meta','extra') - when /^0~(toc|structure)\s+(.+?)$/; header('structure',$2,'proc','instruct') - when /^0~(level|page|markup)\s+(.+?)$/; header('markup',$2,'process','instruct') - when /^0~(bold)\s+(.+?)$/; header($1,$2,'process','instruct') - when /^0~(italics|itali[sz]e)\s+(.+?)$/; header('italicize',$2,'process','instruct') - when /^0~(vocabulary|wordlist)\s+(.+?)$/; header('vocabulary',$2,'process','instruct') - when /^0~(skin)\s+(.+?)$/; header($1,$2,'process','instruct') - when /^0~(css|stylesheet)\s+(.+?)$/; header('css',$2,'process','instruct') - when /^0~(links)\s+(.+?)$/; header($1,$2,'process','instruct') - when /^0~(prefix)\s+(.+?)$/; header($1,$2,'process','instruct') - when /^0~(suffix)\s+(.+?)$/; header($1,$2,'process','instruct') - when /^0~(information)\s+(.+?)$/; header($1,$2,'process','instruct') - when /^0~(contact)\s+(.+?)$/; header($1,$2,'process','instruct') - when /^0~(rcs|cvs)\s+(.+?)$/; header('version',$2,'process','instruct') - else nil - end - end - def start_is_at - meta=case @p - when /^@(title):\s+(.+?)$/; header($1,@md.dc_title,'meta','dc') #dc 1 + when /^#{Mx[:meta_o]}(title)#{Mx[:meta_c]}\s*(.+?)$/; header($1,@md.dc_title,'meta','dc') #dc 1 #when /^@(subtitle):\s+(.+?)$/; header($1,$2,'meta','extra') - when /^@(creator|author):\s+(.+?)$/; header('creator',$2,'meta','dc') #dc 2 - when /^@(subject):\s+(.+?)$/; header($1,$2,'meta','dc') #dc 3 - when /^@(description):\s+(.+?)$/; header($1,$2,'meta','dc') #dc 4 - when /^@(publisher):\s+(.+?)$/; header($1,$2,'meta','dc') #dc 5 - when /^@(contributor):\s+(.+?)$/; header($1,$2,'meta','dc') #dc 6 - when /^@(date):\s+(.+?)$/; header($1,$2,'meta','dc') #dc 7 - when /^@(date\.created):\s+(.+?)$/; header($1,$2,'meta','extra') - when /^@(date\.issued):\s+(.+?)$/; header($1,$2,'meta','extra') - when /^@(date\.available):\s+(.+?)$/; header($1,$2,'meta','extra') - when /^@(date\.valid):\s+(.+?)$/; header($1,$2,'meta','extra') - when /^@(date\.modified):\s+(.+?)$/; header($1,$2,'meta','extra') - when /^@(type):\s+(.+?)$/; header($1,$2,'meta','dc') #dc 8 - when /^@(format):\s+(.+?)$/; header($1,$2,'meta','dc') #dc 9 - when /^@(identifier):\s+(.+?)$/; header($1,$2,'meta','dc') #dc 10 - when /^@(source):\s+(.+?)$/; header($1,$2,'meta','dc') #dc 11 - when /^@(language):\s+(.+?)$/; header($1,$2,'meta','dc') #dc 12 - when /^@(relation):\s+(.+?)$/; header($1,$2,'meta','dc') #dc 13 - when /^@(coverage):\s+(.+?)$/; header($1,$2,'meta','dc') #dc 14 - when /^@(rights):\s+(.+?)$/; header($1,$2,'meta','dc') #dc 15 - when /^@(keywords):\s+(.+?)$/; header($1,$2,'meta','extra') - when /^@(copyright):\s+(.+?)$/; header($1,$2,'meta','extra') - when /^@(translator|translated_by):\s+(.+?)$/; header('translator',$2) - when /^@(illustrator|illustrated_by):\s+(.+?)$/; header('illustrator',$2) - when /^@(prepared_by):\s+(.+?)$/; header($1,$2,'meta','extra') - when /^@(digitized_by):\s+(.+?)$/; header($1,$2,'meta','extra') - when /^@(comments?):\s+(.+?)$/; header($1,$2,'meta','extra') - when /^@(abstract):\s+(.+?)$/; header($1,$2,'meta','extra') - when /^@(tags?):\s+(.+?)$/; header($1,$2,'meta','extra') - when /^@(catalogue):\s+(.+?)$/; header($1,$2,'meta','extra') - when /^@(class(?:ify)?_loc):\s+(.+?)$/; header('classify_loc',$2,'meta','extra') - when /^@(class(?:ify)?_dewey):\s+(.+?)$/; header('classify_dewey',$2,'meta','extra') - when /^@(class(?:ify)?_pg):\s+(.+?)$/; header('classify_pg',$2,'meta','extra') - when /^@(class(?:ify)?_isbn):\s+(.+?)$/; header('classify_isbn',$2,'meta','extra') - when /^@(toc|structure):\s+(.+?)$/; header('structure',$2,'process','instruct') - when /^@(level|page|markup):\s+(.+?)$/; header('markup',$2,'process','instruct') - when /^@(bold):\s+(.+?)$/; header($1,$2,'process','instruct') - when /^@(italics|itali[sz]e):\s+(.+?)$/; header('italicize',$2,'process','instruct') - when /^@(vocabulary|wordlist):\s+(.+?)$/; header('vocabulary',$2,'process','instruct') - when /^@(skin):\s+(.+?)$/; header($1,$2,'process','instruct') - when /^@(css|stylesheet):\s+(.+?)$/; header('css',$2,'process','instruct') - when /^@(links):\s+(.+?)$/; header($1,$2,'process','instruct') - when /^@(prefix):\s+(.+?)$/; header($1,$2,'process','instruct') #add a & b - when /^@(suffix):\s+(.+?)$/; header($1,$2,'process','instruct') - when /^@(information):\s+(.+?)$/; header($1,$2,'process','instruct') - when /^@(contact):\s+(.+?)$/; header($1,$2,'process','instruct') - when /^@(rcs|cvs):\s+(.+?)$/; header('version',$2,'process','instruct') + when /^#{Mx[:meta_o]}(creator|author)#{Mx[:meta_c]}\s*(.+?)$/; header('creator',$2,'meta','dc') #dc 2 + when /^#{Mx[:meta_o]}(subject)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 3 + when /^#{Mx[:meta_o]}(description)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 4 + when /^#{Mx[:meta_o]}(publisher)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 5 + when /^#{Mx[:meta_o]}(contributor)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 6 + when /^#{Mx[:meta_o]}(date)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 7 + when /^#{Mx[:meta_o]}(date\.created)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','extra') + when /^#{Mx[:meta_o]}(date\.issued)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','extra') + when /^#{Mx[:meta_o]}(date\.available)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','extra') + when /^#{Mx[:meta_o]}(date\.valid)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','extra') + when /^#{Mx[:meta_o]}(date\.modified)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','extra') + when /^#{Mx[:meta_o]}(type)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 8 + when /^#{Mx[:meta_o]}(format)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 9 + when /^#{Mx[:meta_o]}(identifier)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 10 + when /^#{Mx[:meta_o]}(source)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 11 + when /^#{Mx[:meta_o]}(language)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 12 + when /^#{Mx[:meta_o]}(relation)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 13 + when /^#{Mx[:meta_o]}(coverage)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 14 + when /^#{Mx[:meta_o]}(rights)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','dc') #dc 15 + when /^#{Mx[:meta_o]}(keywords)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','extra') + when /^#{Mx[:meta_o]}(copyright)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','extra') + when /^#{Mx[:meta_o]}(translator|translated_by)#{Mx[:meta_c]}\s*(.+?)$/; header('translator',$2) + when /^#{Mx[:meta_o]}(illustrator|illustrated_by)#{Mx[:meta_c]}\s*(.+?)$/; header('illustrator',$2) + when /^#{Mx[:meta_o]}(prepared_by)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','extra') + when /^#{Mx[:meta_o]}(digitized_by)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','extra') + when /^#{Mx[:meta_o]}(comments?)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','extra') + when /^#{Mx[:meta_o]}(abstract)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','extra') + when /^#{Mx[:meta_o]}(tags?)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','extra') + when /^#{Mx[:meta_o]}(catalogue)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'meta','extra') + when /^#{Mx[:meta_o]}(class(?:ify)?_loc)#{Mx[:meta_c]}\s*(.+?)$/; header('classify_loc',$2,'meta','extra') + when /^#{Mx[:meta_o]}(class(?:ify)?_dewey)#{Mx[:meta_c]}\s*(.+?)$/; header('classify_dewey',$2,'meta','extra') + when /^#{Mx[:meta_o]}(class(?:ify)?_pg)#{Mx[:meta_c]}\s*(.+?)$/; header('classify_pg',$2,'meta','extra') + when /^#{Mx[:meta_o]}(class(?:ify)?_isbn)#{Mx[:meta_c]}\s*(.+?)$/; header('classify_isbn',$2,'meta','extra') + when /^#{Mx[:meta_o]}(toc|structure)#{Mx[:meta_c]}\s*(.+?)$/; header('structure',$2,'process','instruct') + when /^#{Mx[:meta_o]}(level|page|markup)#{Mx[:meta_c]}\s*(.+?)$/; header('markup',$2,'process','instruct') + when /^#{Mx[:meta_o]}(bold)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'process','instruct') + when /^#{Mx[:meta_o]}(italics|itali[sz]e)#{Mx[:meta_c]}\s*(.+?)$/; header('italicize',$2,'process','instruct') + when /^#{Mx[:meta_o]}(vocabulary|wordlist)#{Mx[:meta_c]}\s*(.+?)$/; header('vocabulary',$2,'process','instruct') + when /^#{Mx[:meta_o]}(skin)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'process','instruct') + when /^#{Mx[:meta_o]}(css|stylesheet)#{Mx[:meta_c]}\s*(.+?)$/; header('css',$2,'process','instruct') + when /^#{Mx[:meta_o]}(links)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'process','instruct') + when /^#{Mx[:meta_o]}(prefix)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'process','instruct') #add a & b + when /^#{Mx[:meta_o]}(suffix)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'process','instruct') + when /^#{Mx[:meta_o]}(information)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'process','instruct') + when /^#{Mx[:meta_o]}(contact)#{Mx[:meta_c]}\s*(.+?)$/; header($1,$2,'process','instruct') + when /^#{Mx[:meta_o]}(rcs|cvs)#{Mx[:meta_c]}\s*(.+?)$/; header('version',$2,'process','instruct') else nil end end def dublin - out=if @p =~/^0~\S+\s/; start_is_zero - elsif @p =~/^@\S+:[+-]?\s/; start_is_at + out=if @p =~/^#{Mx[:meta_o]}\S+?#{Mx[:meta_c]}/ + start_is_match else nil end end def meta - out=if @p =~/^0~\S+\s/; start_is_zero - elsif @p =~/^@\S+:[+-]?\s/; start_is_at + out=if @p =~/^#{Mx[:meta_o]}\S+?#{Mx[:meta_c]}/ + start_is_match else nil end end @@ -287,30 +233,30 @@ module SiSU_text_parts_flatfile @@dl ||=SiSU_Env::Info_env.new.digest.length end def lev_segname_para_ocn - if @para =~/^(\d~|<:.+?>).+?<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}>.*/ - if /^([1-6])~(\S+)\s+(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}>/m.match(@para) + if @para =~/^(?:#{Mx[:lv_o]}[1-9]:\S*?#{Mx[:lv_c]}|<:.+?>).+?#{Mx[:id_o]}~(\d+);(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}#{Mx[:id_c]}.*/ + if /^(#{Mx[:lv_o]}([1-6]):(\S+?)#{Mx[:lv_c]})\s*(\S.+?)#{Mx[:id_o]}~(\d+);(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}#{Mx[:id_c]}/m.match(@para) @format,segname,@text,@ocn=$1,$2,$3,$4 @format="#@format~#{segname}" # - elsif /^([1-6]~)\s+(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}>/m.match(@para) + elsif /^(#{Mx[:lv_o]}([1-6]):#{Mx[:lv_c]})\s*(\S.+?)#{Mx[:id_o]}~(\d+);(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}#{Mx[:id_c]}/m.match(@para) @format,@text,@ocn=$1,$2,$3 - elsif /<:(.+?)>\s*(\S.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}>/m.match(@para) + elsif /<:(.+?)>\s*(\S.+?)#{Mx[:id_o]}~(\d+);(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}#{Mx[:id_c]}/m.match(@para) @format,@text,@ocn=$1,$2,$3 - elsif /^([1-6])~(\S+)\s+(\S.+?)<~(0);(?:\w|[0-6]:)\d+;\w\d+><[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}>/m.match(@para) + elsif /^(#{Mx[:lv_o]}([1-6]):(\S+?)#{Mx[:lv_c]})\s*(\S.+?)#{Mx[:id_o]}~(0);(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}#{Mx[:id_c]}/m.match(@para) @@alt_id_count+=1 @format,segname,@text,@ocn=$1,$2,$3,"x#{@@alt_id_count}" @format="#@format~#{segname}" # - elsif /^([1-6]~)\s+(\S.+?)<~(0);(?:\w|[0-6]:)\d+;\w\d+><[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}>/m.match(@para) + elsif /^(#{Mx[:lv_o]}([1-6]):#{Mx[:lv_c]})\s*(\S.+?)#{Mx[:id_o]}~(0);(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}#{Mx[:id_c]}/m.match(@para) @@alt_id_count+=1 @format,@text,@ocn=$1,$2,"x#{@@alt_id_count}" end else - if /(.+?)<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}>/m.match(@para) + if /(.+?)#{Mx[:id_o]}~(\d+);(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}#{Mx[:id_c]}/m.match(@para) @text,@ocn=$1,$2 end - if @para !~/<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}>|^$/ #added 2002w06 + if @para !~/#{Mx[:id_o]}~(\d+);(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}[0-9a-f]{#{@@dl}}:[0-9a-f]{#{@@dl}}#{Mx[:id_c]}|^$/ #added 2002w06 @text=/(.+?)/m.match(@para)[1] end - if /^(\d)~\S*\s+(.+)/m.match(@para) + if /^(#{Mx[:lv_o]}([1-9]):\S*?#{Mx[:lv_c]})\s*(.+)/m.match(@para) @format,@text=$1,$2 end end |