[DRE-commits] [ruby-org] 220/303: Simplifies adding lines to output buffer.

Jérémy Bobbio lunar at alioth.debian.org
Fri Aug 9 17:34:01 UTC 2013


This is an automated email from the git hooks/post-receive script.

lunar pushed a commit to branch master
in repository ruby-org.

commit afaaaefae85fc9358a1319286b44d555a9283605
Author: vonavi <ivvl82 at gmail.com>
Date:   Thu Jan 10 19:31:00 2013 +0300

    Simplifies adding lines to output buffer.
---
 lib/org-ruby/parser.rb |   30 ++++--------------------------
 1 file changed, 4 insertions(+), 26 deletions(-)

diff --git a/lib/org-ruby/parser.rb b/lib/org-ruby/parser.rb
index 1f73d48..4d70607 100644
--- a/lib/org-ruby/parser.rb
+++ b/lib/org-ruby/parser.rb
@@ -255,34 +255,12 @@ module Orgmode
         # See if we're carrying paragraph payload, and output
         # it if we're about to switch to some other output type.
         output_buffer.prepare(line)
-        case line.paragraph_type
-        when :metadata, :table_separator, :blank, :comment, :property_drawer_item, :property_drawer_begin_block, :property_drawer_end_block
-
-          output_buffer << line.line << "\n" if output_buffer.preserve_whitespace?
-
-        when :begin_block, :end_block
-
-          # Nothing
-
-        when :table_row, :table_header
-
-          if output_buffer.preserve_whitespace?
-            output_buffer << line.line << "\n"
-          else
-            output_buffer << line.line.lstrip << "\n"
-          end
-
-        when :src
-
-          output_buffer << line.output_text << "\n"
-
-        when :example_line
-
+        if output_buffer.preserve_whitespace? and not line.begin_block?
           output_buffer << line.output_text << "\n"
-
         else
-          if output_buffer.preserve_whitespace? then
-            output_buffer << line.output_text << "\n"
+          case line.paragraph_type
+          when :metadata, :table_separator, :blank, :comment, :property_drawer_item, :property_drawer_begin_block, :property_drawer_end_block, :begin_block, :end_block
+            # Nothing
           else
             output_buffer << line.output_text.strip << "\n"
           end

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-org.git



More information about the Pkg-ruby-extras-commits mailing list