public static string GetCategory(ChangelogSettings settings, GitChangelogItem message, GitCommitMessageLine line)
 {
     foreach (var token in line.Tokens)
     {
         var category = settings.Categories.FirstOrDefault(c => c.Filter.IsMatch(token));
         if (category != null)
         {
             var cleanToken = category.Filter.CleanValue(token);
             line.ReplaceMessagePart(token, cleanToken);
             return(category.DisplayName);
         }
     }
     return(null);
 }
        public static string GetLinkText(ChangelogSettings settings, GitChangelogItem message, GitCommitMessageLine line)
        {
            List <GitChangelogLink> links = new List <GitChangelogLink>();

            foreach (var token in line.Tokens)
            {
                var link = settings.Links.FirstOrDefault(c => c.Filter.IsMatch(token));
                if (link != null)
                {
                    links.Add(new GitChangelogLink(token, link));
                    line.ReplaceMessagePart(token, "");
                }
            }
            StringBuilder sb = new StringBuilder();

            foreach (var link in links)
            {
                sb.Append(link.GetLink(settings)).Append(" ");
            }
            return(sb.ToString());
        }