try new markup function
[mirror/dsa-puppet.git] / modules / motd / templates / motd.erb
index 777ce8f..496b5dd 100644 (file)
@@ -12,12 +12,8 @@ def wrap(s, width=78)
 end
 
 def markup(l)
-  if l =~ /\[\[(\*|-)?(.*?)\]\]/
-    l = $2
-  end
-  if l =~ /\[\[(.*?)\|(.*?)\]\]/
-    l = $2
-  end
+  l = l.gsub(/\[\[(.*?)\|(.*?)\]\]/, '\2')
+  l = l.gsub(/\[\[(\*|-)?(.*?)\]\]/, '\2')
   return l
 end