Пример #1
0
        public static List <SplitToken> SplitBlockquoteTokens(ImmutableArray <IMarkdownToken> tokens)
        {
            var        splitTokens = new List <SplitToken>();
            SplitToken splitToken  = null;

            foreach (var token in tokens)
            {
                if (token is IDfmBlockSpecialSplitToken)
                {
                    splitToken = new SplitToken(token);
                    splitTokens.Add(splitToken);
                }
                else
                {
                    if (splitToken != null)
                    {
                        splitToken.InnerTokens.Add(token);
                        continue;
                    }
                    splitToken = new SplitToken(token);
                    splitToken.InnerTokens.Add(token);
                    splitTokens.Add(splitToken);
                }
            }
            return(splitTokens);
        }
Пример #2
0
 public static List<SplitToken> SplitBlockquoteTokens(ImmutableArray<IMarkdownToken> tokens)
 {
     var splitTokens = new List<SplitToken>();
     SplitToken splitToken = null;
     foreach (var token in tokens)
     {
         if (token is DfmSectionBlockToken || token is DfmNoteBlockToken)
         {
             splitToken = new SplitToken(token);
             splitTokens.Add(splitToken);
         }
         else
         {
             if (splitToken != null)
             {
                 splitToken.InnerTokens.Add(token);
                 continue;
             }
             splitToken = new SplitToken(token);
             splitToken.InnerTokens.Add(token);
             splitTokens.Add(splitToken);
         }
     }
     return splitTokens;
 }