Skip to content

Commit

Permalink
re-work callout tag conditional
Browse files Browse the repository at this point in the history
Output a warning if the type is not supported and default to info
  • Loading branch information
thomas-mcdonald committed Apr 24, 2015
1 parent 4c3c402 commit 58c208e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions docs/_plugins/callout.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ class CalloutTag < Liquid::Block

def initialize(tag_name, type, tokens)
super
@type = type
if type == "danger"
@type = "danger"
elsif type == "warning"
@type = "warning"
elsif type == "info"
type.strip!
if %w(info danger warning).include?(type)
@type = type
else
puts "#{type} callout not supported. Defaulting to info"
@type = "info"
end
end
Expand Down

0 comments on commit 58c208e

Please sign in to comment.