lib/asciidoctor/extensions.rb in asciidoctor-2.0.18 vs lib/asciidoctor/extensions.rb in asciidoctor-2.0.19

- old
+ new

@@ -1107,10 +1107,13 @@ end # Public: Checks whether any {BlockProcessor} extensions are registered to # handle the specified block name appearing on the specified context. # + # This method assumes you've called blocks? first to check whether any + # block extensions are registered. + # # Returns the [Extension] proxy object for the BlockProcessor that matches # the block name and context or false if no match is found. def registered_for_block? name, context if (ext = @block_extensions[name.to_sym]) (ext.config[:contexts].include? context) ? ext : false @@ -1122,10 +1125,13 @@ # Public: Retrieves the {Extension} proxy object for the BlockProcessor registered # to handle block content with the name. # # name - the String or Symbol (coersed to a Symbol) macro name # + # This method assumes you've called blocks? first to check whether any + # block extensions are registered. + # # Returns the [Extension] object stored in the registry that proxies the # corresponding BlockProcessor or nil if a match is not found. def find_block_extension name @block_extensions[name.to_sym] end @@ -1198,10 +1204,13 @@ # Public: Checks whether any {BlockMacroProcessor} extensions are registered to # handle the block macro with the specified name. # # name - the String or Symbol (coersed to a Symbol) macro name # + # This method assumes you've called block_macros? first to check whether any + # block macro extensions are registered. + # # Returns the [Extension] proxy object for the BlockMacroProcessor that matches # the macro name or false if no match is found. #-- # TODO only allow blank target if format is :short def registered_for_block_macro? name @@ -1211,10 +1220,13 @@ # Public: Retrieves the {Extension} proxy object for the BlockMacroProcessor registered # to handle a block macro with the specified name. # # name - the String or Symbol (coersed to a Symbol) macro name # + # This method assumes you've called block_macros? first to check whether any + # block macro extensions are registered. + # # Returns the [Extension] object stored in the registry that proxies the # corresponding BlockMacroProcessor or nil if a match is not found. def find_block_macro_extension name @block_macro_extensions[name.to_sym] end @@ -1287,10 +1299,13 @@ # Public: Checks whether any {InlineMacroProcessor} extensions are registered to # handle the inline macro with the specified name. # # name - the String or Symbol (coersed to a Symbol) macro name # + # This method assumes you've called inline_macros? first to check whether any + # inline macro extensions are registered. + # # Returns the [Extension] proxy object for the InlineMacroProcessor that matches # the macro name or false if no match is found. def registered_for_inline_macro? name (ext = @inline_macro_extensions[name.to_sym]) ? ext : false end @@ -1298,17 +1313,23 @@ # Public: Retrieves the {Extension} proxy object for the InlineMacroProcessor registered # to handle an inline macro with the specified name. # # name - the String or Symbol (coersed to a Symbol) macro name # + # This method assumes you've called inline_macros? first to check whether any + # inline macro extensions are registered. + # # Returns the [Extension] object stored in the registry that proxies the # corresponding InlineMacroProcessor or nil if a match is not found. def find_inline_macro_extension name @inline_macro_extensions[name.to_sym] end # Public: Retrieves the {Extension} proxy objects for all # InlineMacroProcessor instances in this registry. + # + # This method assumes you've called inline_macros? first to check whether any + # inline macro extensions are registered. # # Returns an [Array] of Extension proxy objects. def inline_macros @inline_macro_extensions.values end