diff options
Diffstat (limited to 'lib/sisu/v3dv/dal_character_check.rb')
-rw-r--r-- | lib/sisu/v3dv/dal_character_check.rb | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/lib/sisu/v3dv/dal_character_check.rb b/lib/sisu/v3dv/dal_character_check.rb index 2857cb98..4ec95f82 100644 --- a/lib/sisu/v3dv/dal_character_check.rb +++ b/lib/sisu/v3dv/dal_character_check.rb @@ -69,25 +69,26 @@ module SiSU_DAL_CharacterCheck endnote_no=1 data.each do |dob| unless dob.is =='table' - dob.obj.strip! - dob.obj.gsub!(/^[{~}]\s*$/,'') - dob.obj.gsub!(/~#\s*/,"#{Mx[:pa_non_object_no_heading]}") - dob.obj.gsub!(/-#\s*/,"#{Mx[:pa_non_object_dummy_heading]}") - dob.obj.gsub!(/(#{Mx[:en_a_o]})\s*\s+/,'\1 '); dob.obj.gsub!(/(~\{\s*)\s+/,'\1 ') - dob.obj.gsub!(/ \/\//,"#{Mx[:br_line]}") - dob.obj.gsub!(/<br>/,"#{Mx[:br_line]}") #needed by xml, xhtml etc. - dob.obj.gsub!(/\t/,' ') - dob.obj.gsub!(/\342\200\231/u,"'") #if dob =~/’/ #Avoid #‘ ’ #“ ” - dob.obj.gsub!(/�/u,' ') #watch, replace with char code - dob.obj.gsub!(/·/u,'*') - dob.obj.gsub!(/\\copy(?:right)?\b/,'©') - dob.obj.gsub!(/\\trademark\b|\\tm\b/,'®') + dob.obj=dob.obj.strip. + gsub(/^[{~}]\s*$/,''). + gsub(/~#\s*/,"#{Mx[:pa_non_object_no_heading]}"). + gsub(/-#\s*/,"#{Mx[:pa_non_object_dummy_heading]}"). + gsub(/(#{Mx[:en_a_o]})\s*\s+/,'\1 '). + gsub(/(~\{\s*)\s+/,'\1 '). + gsub(/ \/\//,"#{Mx[:br_line]}"). + gsub(/<br>/,"#{Mx[:br_line]}"). #needed by xml, xhtml etc. + gsub(/\t/,' '). + gsub(/\342\200\231/u,"'"). #if dob =~/’/ #Avoid #‘ ’ #“ ” + gsub(/�/u,' '). #watch, replace with char code + gsub(/·/u,'*'). + gsub(/\\copy(?:right)?\b/,'©'). + gsub(/\\trademark\b|\\tm\b/,'®') dob.obj=dob.obj + "\n" unless dob.is =~/^code/ case dob.obj when /\^~/ #% Note must do this first (earlier loop) and then enter gathered data into ~^\d+ sub_dob=dob.obj.dup - @endnote_array << sub_dob.gsub!(/\n/,'').gsub!(/\^~\s+(.+)\s*/,%{#{Mx[:en_a_o]}#{endnote_no} \\1 #{Mx[:en_a_c]}}).strip + @endnote_array << sub_dob.gsub(/\n/,'').gsub(/\^~\s+(.+)\s*/,%{#{Mx[:en_a_o]}#{endnote_no} \\1 #{Mx[:en_a_c]}}).strip endnote_no+=1 dob=nil if dob.obj =~/\^~ .+/ #watch, removes 'binary' endnote now in endnote array for later insertion end |