Example #1
0
 public ParsedTopic(TopicPropertyCollection properties, TopicRevisionCollection topicLinks, 
     ExternalReferencesMap externalReferences)
 {
     _properties.AddRange(properties);
     _topicLinks.AddRange(topicLinks);
     _externalReferences.AddRange(externalReferences); 
 }
Example #2
0
        private static TopicRevisionCollection ParseTopicLinks(string text)
        {
            TopicRevisionCollection referencedTopics = new TopicRevisionCollection();

            // TODO: Move Formatter functionality to TopicParser
            MatchCollection wikiNames = Formatter.extractWikiNames.Matches(text);

            List<string> processed = new List<string>();

            foreach (Match m in wikiNames)
            {
                string each = m.Groups["topic"].ToString();
                if (processed.Contains(each))
                {
                    continue;   // skip duplicates
                }

                processed.Add(each);

                TopicRevision referencedTopic = new TopicRevision(StripTopicNameEscapes(each));
                referencedTopics.Add(referencedTopic);
            }

            return referencedTopics;
        }