[DRE-commits] [ruby-org] 63/303: Fixed bug; Orgmode::Parser.to_html was no longer idempotent, and that messed up my rake testcase:accept task.

Jérémy Bobbio lunar at alioth.debian.org
Fri Aug 9 17:33:28 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 6a664592ccbf191772ab7044485b7b3e088cc4ae
Author: Brian Dewey <bdewey at gmail.com>
Date:   Tue Dec 29 19:22:42 2009 -0800

    Fixed bug; Orgmode::Parser.to_html was no longer idempotent, and that messed up my rake testcase:accept task.
---
 lib/org-ruby/parser.rb                  |    3 ++-
 spec/html_examples/export-keywords.html |    4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/lib/org-ruby/parser.rb b/lib/org-ruby/parser.rb
index fd35dac..702d7f0 100644
--- a/lib/org-ruby/parser.rb
+++ b/lib/org-ruby/parser.rb
@@ -68,8 +68,8 @@ module Orgmode
       @headlines = Array.new
       @current_headline = nil
       @header_lines = []
-      @headline_number_stack = []
       @in_buffer_settings = { }
+      @headline_number_stack = []
       @options = { }
       mode = :normal
       @lines.each do |line|
@@ -130,6 +130,7 @@ module Orgmode
 
     # Converts the loaded org-mode file to HTML.
     def to_html
+      @headline_number_stack = []
       output = ""
       if @in_buffer_settings["TITLE"] then
         output << "<p class=\"title\">#{@in_buffer_settings["TITLE"]}</p>\n"
diff --git a/spec/html_examples/export-keywords.html b/spec/html_examples/export-keywords.html
index f9c95ad..92da491 100644
--- a/spec/html_examples/export-keywords.html
+++ b/spec/html_examples/export-keywords.html
@@ -1,4 +1,4 @@
 <p class="title">export-keywords.org</p>
 <p>Testing that I can export keywords.</p>
-<h1><span class="heading-number heading-number-1">3 </span><span class="todo-keyword TODO">TODO </span>This is a todo item.</h1>
-<h1><span class="heading-number heading-number-1">4 </span><span class="todo-keyword DONE">DONE </span>this item is done!</h1>
+<h1><span class="heading-number heading-number-1">1 </span><span class="todo-keyword TODO">TODO </span>This is a todo item.</h1>
+<h1><span class="heading-number heading-number-1">2 </span><span class="todo-keyword DONE">DONE </span>this item is done!</h1>

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