diff --git a/src/commentscan.l b/src/commentscan.l
index 9a51e6b..747ce11 100644
--- a/src/commentscan.l
+++ b/src/commentscan.l
@@ -880,6 +880,7 @@ LABELID   [a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF\-]*
 CITEID    [a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF\-:/]*
 SCOPEID   {ID}({ID}*{BN}*"::"{BN}*)*({ID}?)
 SCOPENAME "$"?(({ID}?{BN}*("::"|"."){BN}*)*)((~{BN}*)?{ID})
+TMPLSPEC  "<"{BN}*[^>]+{BN}*">"
 MAILADDR   [a-z_A-Z0-9.+\-]+"@"[a-z_A-Z0-9\-]+("."[a-z_A-Z0-9\-]+)+[a-z_A-Z0-9\-]+
 RCSTAG    "$"{ID}":"[^\n$]+"$"

@@ -1342,6 +1343,14 @@ RCSTAG    "$"{ID}":"[^\n$]+"$"

   /* ------ handle argument of class/struct/union command --------------- */

+<ClassDocArg1>{SCOPENAME}{TMPLSPEC}    { // first argument
+                                          QString name(yytext);
+                                          name = name.replace(QRegExp("<[ \t\n\r]*"), "< ");
+                                          name = name.replace(QRegExp("[ \t\n\r]*>"), " >");
+                                          name = name.replace(QRegExp("[ \t\n\r]*,[ \t\n\r]*"), ", ");
+                                          current->name = name.data();
+                                         BEGIN( ClassDocArg2 );
+                                       }
 <ClassDocArg1>{SCOPENAME}              { // first argument
                                          current->name = substitute(yytext,".","::");
                                          if (current->section==Entry::PROTOCOLDOC_SEC)
