[Groonga-commit] ranguba/chupa-text-decomposer-pdf at 0e64517 [master] Don't add a needless new line with old Poppler

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Feb 17 23:54:40 JST 2014


Kouhei Sutou	2014-02-17 23:54:40 +0900 (Mon, 17 Feb 2014)

  New Revision: 0e645170d8ed969d94155ae5a43469d61706c496
  https://github.com/ranguba/chupa-text-decomposer-pdf/commit/0e645170d8ed969d94155ae5a43469d61706c496

  Message:
    Don't add a needless new line with old Poppler

  Modified files:
    lib/chupa-text/decomposers/pdf.rb

  Modified: lib/chupa-text/decomposers/pdf.rb (+3 -1)
===================================================================
--- lib/chupa-text/decomposers/pdf.rb    2014-02-17 23:49:39 +0900 (109db4d)
+++ lib/chupa-text/decomposers/pdf.rb    2014-02-17 23:54:40 +0900 (5578699)
@@ -34,7 +34,9 @@ module ChupaText
         document.each do |page|
           page_text = page.get_text
           next if page_text.empty?
-          text << "\n" unless text.empty?
+          if !text.empty? and !text.end_with?("\n")
+            text << "\n"
+          end
           text << page_text
         end
         text_data = TextData.new(text)
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index