diff --git a/showdependencygraph.cgi b/showdependencygraph.cgi
index b12e65c853d0514ee686e97328943b9f0e665f84..9851a218ce0bc48e5c7a3f723240b6b456ecbf94 100755
--- a/showdependencygraph.cgi
+++ b/showdependencygraph.cgi
@@ -65,7 +65,7 @@ sub CreateImagemap {
             $default = qq{<area alt="" shape="default" href="$1">\n};
         }
 
-        if ($line =~ /^rectangle \((.*),(.*)\) \((.*),(.*)\) (http[^ ]*) (\d+)$/) {
+        if ($line =~ /^rectangle \((.*),(.*)\) \((.*),(.*)\) (http[^ ]*) (\d+)(\\n.*)?$/) {
             my ($leftx, $rightx, $topy, $bottomy, $url, $bugid) = ($1, $3, $2, $4, $5, $6);
 
             # Pick up bugid from the mapdata label field. Getting the title from