From 58c208ec73837925f63a5cd63f1766502a565d84 Mon Sep 17 00:00:00 2001 From: Thomas McDonald Date: Fri, 24 Apr 2015 22:21:12 +0100 Subject: [PATCH] re-work callout tag conditional Output a warning if the type is not supported and default to info --- docs/_plugins/callout.rb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/_plugins/callout.rb b/docs/_plugins/callout.rb index 29ecbc99d779..536ca588ef3b 100644 --- a/docs/_plugins/callout.rb +++ b/docs/_plugins/callout.rb @@ -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