Skip to content

Commit

Permalink
#219 quick fix for pos_attrs -> position_attrs change in asciidoctor
Browse files Browse the repository at this point in the history
  • Loading branch information
pepijnve committed Mar 23, 2019
1 parent bcc4b06 commit 3945023
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions lib/asciidoctor-diagram/extensions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
module Asciidoctor
module Diagram
module Extensions
if Asciidoctor::VERSION =~ /1\.*/
POSITIONAL_ATTRS_KEY = :pos_attrs
else
POSITIONAL_ATTRS_KEY = :positional_attrs
end

# Provides the means for diagram processors to register supported output formats and image
# generation routines
module FormatRegistry
Expand Down Expand Up @@ -294,7 +300,7 @@ class DiagramBlockProcessor < Asciidoctor::Extensions::BlockProcessor
include DiagramProcessor

def self.inherited(subclass)
subclass.option :pos_attrs, ['target', 'format']
subclass.option Asciidoctor::Diagram::Extensions::POSITIONAL_ATTRS_KEY, ['target', 'format']
subclass.option :contexts, [:listing, :literal, :open]
subclass.option :content_model, :simple
end
Expand All @@ -312,7 +318,7 @@ class DiagramBlockMacroProcessor < Asciidoctor::Extensions::BlockMacroProcessor
include DiagramProcessor

def self.inherited(subclass)
subclass.option :pos_attrs, ['target', 'format']
subclass.option Asciidoctor::Diagram::Extensions::POSITIONAL_ATTRS_KEY, ['target', 'format']
end

def apply_target_subs(parent, target)
Expand Down
2 changes: 1 addition & 1 deletion lib/asciidoctor-diagram/meme/extension.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def lines
end
end

option :pos_attrs, %w(top bottom target format)
option Asciidoctor::Diagram::Extensions::POSITIONAL_ATTRS_KEY, %w(top bottom target format)

def create_source(parent, target, attributes)
attributes = attributes.dup
Expand Down

0 comments on commit 3945023

Please sign in to comment.