]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
re-work callout tag conditional
authorThomas McDonald <tom@conceptcoding.co.uk>
Fri, 24 Apr 2015 21:21:12 +0000 (22:21 +0100)
committerThomas McDonald <tom@conceptcoding.co.uk>
Fri, 24 Apr 2015 21:21:12 +0000 (22:21 +0100)
Output a warning if the type is not supported and default to info

docs/_plugins/callout.rb

index 29ecbc99d7791ce036e4262fc1284c5ed9ea0f8c..536ca588ef3b06036a44458799b7f522128fe8f8 100644 (file)
@@ -6,12 +6,11 @@ module Jekyll
 
       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