[DRE-commits] [ruby-org] 217/303: Suppresses to pop mode for a blank line.

Jérémy Bobbio lunar at alioth.debian.org
Fri Aug 9 17:34:00 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 b3ca9328da471c7c41eea060779565afdaa0b4f4
Author: vonavi <ivvl82 at gmail.com>
Date:   Thu Jan 10 12:52:31 2013 +0300

    Suppresses to pop mode for a blank line.
---
 lib/org-ruby/html_output_buffer.rb    |   19 +++++++++----------
 lib/org-ruby/output_buffer.rb         |   14 ++++++++------
 lib/org-ruby/textile_output_buffer.rb |    2 +-
 3 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/lib/org-ruby/html_output_buffer.rb b/lib/org-ruby/html_output_buffer.rb
index c72b38e..834b388 100644
--- a/lib/org-ruby/html_output_buffer.rb
+++ b/lib/org-ruby/html_output_buffer.rb
@@ -56,26 +56,25 @@ module Orgmode
     # write out one of the block tags in the HtmlBlockTag constant to
     # put this information in the HTML stream.
     def push_mode(mode, indent)
+      super(mode)
       @list_indent_stack.push(indent)
-      if HtmlBlockTag[mode] then
+
+      skip_tag = ((mode_is_table?(mode) and skip_tables?) or
+                  (mode == :src and defined? Pygments))
+      if HtmlBlockTag[mode] and not skip_tag
         css_class = @title_decoration
         css_class = " class=\"src\"" if mode == :src and @block_lang.empty?
         css_class = " class=\"src src-#{@block_lang}\"" if mode == :src and not @block_lang.empty?
         css_class = " class=\"example\"" if (mode == :example || mode == :inline_example)
         css_class = " style=\"text-align: center\"" if mode == :center
 
-        skip = ((mode_is_table?(mode) and skip_tables?) or
-                (mode == :src and defined? Pygments))
-        unless skip
-          output_indentation
-          @logger.debug "#{mode}: <#{HtmlBlockTag[mode]}#{css_class}>\n"
-          @output << "<#{HtmlBlockTag[mode]}#{css_class}>"
-        end
+        output_indentation
+        @logger.debug "#{mode}: <#{HtmlBlockTag[mode]}#{css_class}>\n"
+        @output << "<#{HtmlBlockTag[mode]}#{css_class}>"
         # Entering a new mode obliterates the title decoration
         @title_decoration = ""
       end
-      super(mode)
-      skip
+      not skip_tag
     end
 
     # We are leaving a mode. Close any tags that were opened when
diff --git a/lib/org-ruby/output_buffer.rb b/lib/org-ruby/output_buffer.rb
index c8246c8..92495ff 100644
--- a/lib/org-ruby/output_buffer.rb
+++ b/lib/org-ruby/output_buffer.rb
@@ -181,12 +181,14 @@ module Orgmode
                (not mode_is_block? current_mode))
           pop_mode
         end
+      end
 
+      unless line.paragraph_type == :blank
         # Opens the major mode of line if it exists.
         if line.major_mode
           if (@list_indent_stack.empty? or
               @list_indent_stack.last < line.indent)
-            @output << "\n" unless push_mode(line.major_mode, line.indent)
+            @output << "\n" if push_mode(line.major_mode, line.indent)
           end
         end
         # Open tag that precedes text immediately
@@ -194,12 +196,12 @@ module Orgmode
             @list_indent_stack.last <= line.indent)
           push_mode(line.paragraph_type, line.indent) unless line.block_type
         end
+      end
 
-        # Special case: Only end-block line closes the block
-        if mode_is_block? current_mode
-          pop_mode if (line.end_block? and
-                       line.major_mode == current_mode)
-        end
+      # Special case: Only end-block line closes the block
+      if mode_is_block? current_mode
+        pop_mode if (line.end_block? and
+                     line.major_mode == current_mode)
       end
     end
 
diff --git a/lib/org-ruby/textile_output_buffer.rb b/lib/org-ruby/textile_output_buffer.rb
index 3740463..c8cad77 100644
--- a/lib/org-ruby/textile_output_buffer.rb
+++ b/lib/org-ruby/textile_output_buffer.rb
@@ -19,7 +19,7 @@ module Orgmode
         @add_paragraph = false
         @output << "\n"
       end
-      true
+      false
     end
 
     def pop_mode(mode = nil)

-- 
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