[DRE-commits] [ruby-org] 193/303: Fix error when table starts with hline (fixes #34)

Jérémy Bobbio lunar at alioth.debian.org
Fri Aug 9 17:33:56 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 eff8fb5b10f2fb4b970289b67c4e686e25bdfbac
Author: Waldemar Quevedo <waldemar.quevedo at gmail.com>
Date:   Sun Oct 7 13:39:04 2012 +0900

    Fix error when table starts with hline (fixes #34)
---
 lib/org-ruby/parser.rb         |    4 +++-
 spec/html_examples/tables.html |    6 ++++++
 spec/html_examples/tables.org  |    7 +++++++
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/lib/org-ruby/parser.rb b/lib/org-ruby/parser.rb
index 16ad85a..eba3573 100644
--- a/lib/org-ruby/parser.rb
+++ b/lib/org-ruby/parser.rb
@@ -99,7 +99,9 @@ module Orgmode
       mode = :normal
       previous_line = nil
       table_header_set = false
-      @lines.map { |line| Line.new line, self }.each do |line|
+      @lines.each do |text|
+        line = Line.new text, self
+
         case mode
         when :normal
 
diff --git a/spec/html_examples/tables.html b/spec/html_examples/tables.html
index 2fffbaf..a1c7ff7 100644
--- a/spec/html_examples/tables.html
+++ b/spec/html_examples/tables.html
@@ -33,3 +33,9 @@
   <tr><td>Ten</td><td>Eleven</td><td>Twelve</td></tr>
 </table>
 <p>Only the first row should be a header row.</p>
+<h1>Fix error when table starts with hline (Thanks @til!)</h1>
+<table>
+  <tr><th>foo</th><th>bar</th></tr>
+  <tr><td>1</td><td>2</td></tr>
+</table>
+<p>https://github.com/bdewey/org-ruby/pull/34</p>
diff --git a/spec/html_examples/tables.org b/spec/html_examples/tables.org
index bf87f24..a7b2cb7 100644
--- a/spec/html_examples/tables.org
+++ b/spec/html_examples/tables.org
@@ -48,3 +48,10 @@ Different types of ORG tables.
   |-------+--------+--------|
 
   Only the first row should be a header row.
+
+* Fix error when table starts with hline (Thanks @til!)
+|-----+-----|
+| foo | bar |
+|-----+-----|
+|   1 |   2 |
+https://github.com/bdewey/org-ruby/pull/34

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