Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Simplifies adding lines to output buffer.

  • Loading branch information...
commit afaaaefae85fc9358a1319286b44d555a9283605 1 parent 0c2ac5c
@vonavi authored
Showing with 4 additions and 26 deletions.
  1. +4 −26 lib/org-ruby/parser.rb
View
30 lib/org-ruby/parser.rb
@@ -255,34 +255,12 @@ def self.translate(lines, output_buffer)
# See if we're carrying paragraph payload, and output
# it if we're about to switch to some other output type.
output_buffer.prepare(line)
- case line.paragraph_type
- when :metadata, :table_separator, :blank, :comment, :property_drawer_item, :property_drawer_begin_block, :property_drawer_end_block
-
- output_buffer << line.line << "\n" if output_buffer.preserve_whitespace?
-
- when :begin_block, :end_block
-
- # Nothing
-
- when :table_row, :table_header
-
- if output_buffer.preserve_whitespace?
- output_buffer << line.line << "\n"
- else
- output_buffer << line.line.lstrip << "\n"
- end
-
- when :src
-
- output_buffer << line.output_text << "\n"
-
- when :example_line
-
+ if output_buffer.preserve_whitespace? and not line.begin_block?
output_buffer << line.output_text << "\n"
-
else
- if output_buffer.preserve_whitespace? then
- output_buffer << line.output_text << "\n"
+ case line.paragraph_type
+ when :metadata, :table_separator, :blank, :comment, :property_drawer_item, :property_drawer_begin_block, :property_drawer_end_block, :begin_block, :end_block
+ # Nothing
else
output_buffer << line.output_text.strip << "\n"
end
Please sign in to comment.
Something went wrong with that request. Please try again.