diff options
| author | Dan Allen <dallen@redhat.com> | 2013-06-24 09:51:06 -0600 |
|---|---|---|
| committer | Dan Allen <dallen@redhat.com> | 2013-06-24 09:51:06 -0600 |
| commit | 56a203f3b095e681a05ac6b322b6a33cc6906eec (patch) | |
| tree | 747589a5a51d8a3ac88c3ee5682955ee4e8a8684 /lib | |
| parent | 5ba3a6b820adbda9ba9a8ad1306d7658b5cd24f5 (diff) | |
add captioned_title method to AbstractBlock
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/asciidoctor/abstract_block.rb | 14 | ||||
| -rw-r--r-- | lib/asciidoctor/document.rb | 6 |
2 files changed, 14 insertions, 6 deletions
diff --git a/lib/asciidoctor/abstract_block.rb b/lib/asciidoctor/abstract_block.rb index 21d5e6c7..13f2e700 100644 --- a/lib/asciidoctor/abstract_block.rb +++ b/lib/asciidoctor/abstract_block.rb @@ -63,6 +63,20 @@ class AbstractBlock < AbstractNode end end + # Public: Convenience method that returns the interpreted title of the Block + # with the caption prepended. + # + # Concatenates the value of this Block's caption instance variable and the + # return value of this Block's title method. No space is added between the + # two values. If the Block does not have a caption, the interpreted title is + # returned. + # + # Returns the String title prefixed with the caption, or just the title if no + # caption is set + def captioned_title + %(#{@caption}#{title}) + end + # Public: Determine whether this Block contains block content # # returns Whether this Block has block content diff --git a/lib/asciidoctor/document.rb b/lib/asciidoctor/document.rb index 859f3bcf..5059db4c 100644 --- a/lib/asciidoctor/document.rb +++ b/lib/asciidoctor/document.rb @@ -247,12 +247,6 @@ class Document < AbstractBlock verdict } - # special case like this can be removed once - # we move to a data table for attribute storage - #if @attributes['linkcss'].nil? - # @attributes.delete('linkcss') - #end - @attributes['backend'] ||= DEFAULT_BACKEND @attributes['doctype'] ||= DEFAULT_DOCTYPE update_backend_attributes |
