232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
|
# File 'lib/org2slides.rb', line 232
def insert(line)
@logger.debug "Looking at #{line.paragraph_type}|#{line.assigned_paragraph_type}(#{current_mode}) : #{line.to_s}"
@block_lang = line.block_lang if line.begin_block?
unless should_accumulate_output?(line)
flush!
maintain_mode_stack(line)
end
case
when line.assigned_paragraph_type == :comment
when line.title?
@buffer << line.output_text
when line.raw_text?
@buffer << "\n" << line.output_text if line.raw_text_tag == @buffer_tag
when preserve_whitespace?
@buffer << "\n" << line.output_text unless line.block_type
when line.assigned_paragraph_type == :code
when (line.kind_of? Headline)
add_line_attributes line
@buffer << "\n" << line.output_text.strip
when ([:definition_term, :list_item, :table_row, :table_header,
:horizontal_rule].include? line.paragraph_type)
@buffer << "\n" << line.output_text.strip
when line.paragraph_type == :paragraph
@buffer << "\n"
buffer_indentation
@buffer << line.output_text.strip
end
if mode_is_code? current_mode and not line.block_type
if line.paragraph_type != :blank
if @code_block_indent
@code_block_indent = [@code_block_indent, line.indent].min
else
@code_block_indent = line.indent
end
end
end
@output_type = line.assigned_paragraph_type || line.paragraph_type
end
|