[DRE-commits] [ruby-org] 94/303: Added textile support for definition lists.
Jérémy Bobbio
lunar at alioth.debian.org
Fri Aug 9 17:33:34 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 03298efa64a8b122251d74948ae6db14d586d216
Author: Rüdiger Sonderfeld <ruediger at c-plusplus.de>
Date: Thu Jul 21 02:18:47 2011 +0200
Added textile support for definition lists.
The RedCloth implementation of Textile supports definition lists. There currently is no way to pass options to the textile_output_buffer but in theory by setting `@support_definition_list' to false the output could be prevented and a normal unordered list is generated.
---
lib/org-ruby/textile_output_buffer.rb | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/lib/org-ruby/textile_output_buffer.rb b/lib/org-ruby/textile_output_buffer.rb
index 2ab0eba..3ec91fb 100644
--- a/lib/org-ruby/textile_output_buffer.rb
+++ b/lib/org-ruby/textile_output_buffer.rb
@@ -7,6 +7,7 @@ module Orgmode
def initialize(output)
super(output)
@add_paragraph = false
+ @support_definition_list = true # TODO this should be an option
end
def push_mode(mode)
@@ -64,8 +65,15 @@ module Orgmode
@add_paragraph = false
end
@output << "bq. " if current_mode == :blockquote
- @output << "#" * @list_indent_stack.length << " " if @output_type == :ordered_list
- @output << "*" * @list_indent_stack.length << " " if @output_type == :unordered_list or @output_type == :definition_list
+ if @output_type == :definition_list and @support_definition_list then
+ @output << "-" * @list_indent_stack.length << " "
+ @buffer.sub!("::", ":=")
+ elsif @output_type == :ordered_list then
+ @output << "#" * @list_indent_stack.length << " "
+ elsif @output_type == :unordered_list or \
+ (@output_type == :definition_list and not @support_definition_list) then
+ @output << "*" * @list_indent_stack.length << " "
+ end
@output << inline_formatting(@buffer) << "\n"
end
clear_accumulation_buffer!
--
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