lib/asciidoctor/extensions.rb in asciidoctor-1.5.6 vs lib/asciidoctor/extensions.rb in asciidoctor-1.5.6.1
- old
+ new
@@ -160,13 +160,12 @@
# Returns The parent node into which the blocks are parsed.
#--
# QUESTION is parse_content the right method name? should we wrap in open block automatically?
def parse_content parent, content, attributes = nil
reader = Reader === content ? content : (Reader.new content)
- while reader.has_more_lines?
- block = Parser.next_block reader, parent, (attributes ? attributes.dup : {})
- parent << block if block
+ while ((block = Parser.next_block reader, parent, (attributes ? attributes.dup : {})) && parent << block) ||
+ reader.has_more_lines?
end
parent
end
# TODO fill out remaining methods
@@ -484,11 +483,11 @@
module BlockProcessorDsl
include SyntaxDsl
def contexts *value
- option :contexts, value.flatten
+ option :contexts, value.flatten.to_set
end
alias on_contexts contexts
alias on_context contexts
alias bound_to contexts
end
@@ -1424,10 +1423,10 @@
end
name = args.pop || generate_name
unless args.empty?
raise ::ArgumentError, %(Wrong number of arguments (#{argc} for 1..2))
end
- groups[name] = resolved_group
+ groups[name.to_sym] = resolved_group
end
# Public: Unregister all statically-registered extension groups.
#
# Returns nothing