From: Peter Palfrader Date: Sat, 18 Feb 2012 18:40:18 +0000 (+0100) Subject: try new markup function X-Git-Url: https://git.donarmstrong.com/?p=dsa-puppet.git;a=commitdiff_plain;h=71de817bae812129bc678ca24c45cc5988daff6e try new markup function --- diff --git a/modules/motd/templates/motd.erb b/modules/motd/templates/motd.erb index 777ce8fc..496b5dde 100644 --- a/modules/motd/templates/motd.erb +++ b/modules/motd/templates/motd.erb @@ -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