diff options
Diffstat (limited to 'lib/sisu/v3dv/plaintext.rb')
-rw-r--r-- | lib/sisu/v3dv/plaintext.rb | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/lib/sisu/v3dv/plaintext.rb b/lib/sisu/v3dv/plaintext.rb index ba1f30d2..557c5f1b 100644 --- a/lib/sisu/v3dv/plaintext.rb +++ b/lib/sisu/v3dv/plaintext.rb @@ -216,15 +216,15 @@ WOK end def plaintext_structure(dob='',p_num='') #% Used to extract the structure of a document lv=n=n3=nil - if dob.is=='heading' + if dob.is==:heading lv=dob.ln n=lv - 1 n3=lv + 2 end util=nil - wrapped=if dob.is =='para' \ - or dob.is=='heading' - if dob.is=='para' + wrapped=if dob.is ==:para \ + or dob.is==:heading + if dob.is==:para if dob.hang \ and dob.hang =~/[0-9]/ \ and dob.indent != dob.hang @@ -299,7 +299,7 @@ WOK "#{Px[:strike_o]}\\1#{Px[:strike_c]}"). gsub(/#{Mx[:fa_monospace_o]}(.+?)#{Mx[:fa_monospace_c]}/, "#{Px[:monospace_o]}\\1#{Px[:monospace_c]}") - unless dob.is=='code' + unless dob.is==:code dob.obj=dob.obj.gsub(/#{Mx[:lnk_o]}(.+?)#{Mx[:lnk_c]}#{Mx[:rel_o]}\S+?#{Mx[:rel_c]}/,'\1'). gsub(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/,'\1'). gsub(/#{Mx[:lnk_o]}(.+?)#{Mx[:lnk_c]}#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/,'\1 [link: <\2>]'). @@ -323,12 +323,12 @@ WOK gsub(/#{Mx[:gl_o]}#169#{Mx[:gl_c]}/,'©'). gsub(/#{Mx[:gl_o]}#092#{Mx[:gl_c]}/,'\\') end - dob.obj=if dob.of=='block' # watch + dob.obj=if dob.of==:block # watch dob.obj.gsub(/#{Mx[:gl_o]}●#{Mx[:gl_c]}/,"* "). gsub(/#{Mx[:br_line]}|#{Mx[:br_nl]}/,"\n") else dob.obj.gsub(/#{Mx[:br_line]}|#{Mx[:br_nl]}/,"\n\n") end - if dob.is=='code' + if dob.is==:code dob.obj=dob.obj.gsub(/(^|[^}])_([<>])/m,'\1\2'). # _> _< gsub(/(^|[^}])_([<>])/m,'\1\2') # _<_< end @@ -352,16 +352,16 @@ WOK p_num=SiSU_PlaintextFormat::ParagraphNumber.new(dob.ocn).display end end - if dob.is=='heading' \ - or dob.is=='para' + if dob.is==:heading \ + or dob.is==:para plaintext_structure(dob,p_num) - elsif dob.is=='group' \ - or dob.is=='block' \ - or dob.is=='verse' \ - or dob.is=='code' \ - or dob.is=='table' + elsif dob.is==:group \ + or dob.is==:block \ + or dob.is==:verse \ + or dob.is==:code \ + or dob.is==:table @plaintext[:body] << dob.obj + p_num << @br - elsif dob.is=='break' + elsif dob.is==:break sp=' ' ln='-' @plaintext[:body] <<=if dob.obj==Mx[:br_page] \ |