[DRE-commits] [ruby-org] 46/303: Added multi-paragraph list item support.

Jérémy Bobbio lunar at alioth.debian.org
Fri Aug 9 17:33:24 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 7d055613ef0f4818553fc8f83fb18330c34e99fc
Author: Brian Dewey <bdewey at gmail.com>
Date:   Mon Dec 28 12:29:23 2009 -0800

    Added multi-paragraph list item support.
---
 History.txt                            |    2 ++
 lib/org-ruby/output_buffer.rb          |   11 +++++++++++
 spec/html_examples/advanced-lists.html |   31 +++++++++++++++++++++++++++++++
 spec/html_examples/advanced-lists.org  |   31 +++++++++++++++++++++++++++++++
 4 files changed, 75 insertions(+)

diff --git a/History.txt b/History.txt
index b73138f..02493ce 100644
--- a/History.txt
+++ b/History.txt
@@ -2,6 +2,8 @@
 
 * HTML output is now indented
 * Proper support for multi-paragraph list items.
+* Fixed bugs:
+  * "rake spec" wouldn't work on Linux. Needed "require 'rubygems'".
 
 == 0.3.0 / 2009-12-27
 
diff --git a/lib/org-ruby/output_buffer.rb b/lib/org-ruby/output_buffer.rb
index 7998ecd..f71e996 100644
--- a/lib/org-ruby/output_buffer.rb
+++ b/lib/org-ruby/output_buffer.rb
@@ -118,6 +118,17 @@ module Orgmode
           @list_indent_stack.push(line.indent)
           push_mode line.paragraph_type
         end
+      elsif line.blank? then
+
+        # Nothing
+
+      elsif ((line.paragraph_type == :paragraph) and
+             (not @list_indent_stack.empty? and
+              line.indent > @list_indent_stack.last))
+
+        # Nothing -- output this paragraph inside
+        # the list block (ul/ol)
+
       else
         @list_indent_stack = []
         while ((current_mode == :ordered_list) or
diff --git a/spec/html_examples/advanced-lists.html b/spec/html_examples/advanced-lists.html
new file mode 100644
index 0000000..1e1d67e
--- /dev/null
+++ b/spec/html_examples/advanced-lists.html
@@ -0,0 +1,31 @@
+<p>Advanced Lists</p>
+<p><code>org-ruby</code> supports the following list features of <code>org-mode</code>:</p>
+<h1>Nested lists</h1>
+<ul>
+  <li>You can have nested lists</li>
+  <li>This is first-level</li>
+  <ul>
+    <li>This is a nested item</li>
+    <li>This is another nested item</li>
+  </ul>
+  <li>Back to the first level</li>
+  <li>Another first level item</li>
+  <ol>
+    <li>This is a numbered list nested within the unordered list</li>
+    <li>This is another numbered item</li>
+  </ol>
+</ul>
+<p>Note the list ends just some more text. Make sure both list blocks are closed.</p>
+<h1>Multi-paragraph list items</h1>
+<p>This list will end with the end-of-file. Make sure all blocks are closed.</p>
+<ul>
+  <li>This is a list item</li>
+  <li>This list item has multiple paragraphs.</li>
+  <p>This is paragraph two.</p>
+  <p>And paragraph three.</p>
+  <li>Back to a list item.</li>
+  <ul>
+    <li>Nested, just for grins!</li>
+    <li>woo hoo!</li>
+  </ul>
+</ul>
diff --git a/spec/html_examples/advanced-lists.org b/spec/html_examples/advanced-lists.org
new file mode 100644
index 0000000..0bbea79
--- /dev/null
+++ b/spec/html_examples/advanced-lists.org
@@ -0,0 +1,31 @@
+Advanced Lists
+
+=org-ruby= supports the following list features of =org-mode=:
+
+* Nested lists
+
+  - You can have nested lists
+  - This is first-level
+    - This is a nested item
+    - This is another nested item
+  - Back to the first level
+  - Another first level item
+    1. This is a numbered list nested within the unordered list
+    2. This is another numbered item
+
+  Note the list ends just some more text. Make sure both list blocks
+  are closed.
+
+* Multi-paragraph list items
+
+  This list will end with the end-of-file. Make sure all blocks are closed.
+
+  - This is a list item
+  - This list item has multiple paragraphs.
+
+    This is paragraph two.
+
+    And paragraph three.
+  - Back to a list item.
+    - Nested, just for grins!
+    - woo hoo!

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