예제 #1
0
        public override void InternalParse(Container container, IDocumentReader reader, Func <string, bool> predicate, ref List <string> buffer,
                                           ref AttributeList attributes)
        {
            var match = PatternMatcher.Admonition.Match(reader.Line);

            if (!match.Success)
            {
                throw new ArgumentException("not an admonition");
            }

            buffer.Add(match.Groups["text"].Value);
            reader.ReadLine();
            while (reader.Line != null && !PatternMatcher.BlankCharacters.IsMatch(reader.Line))
            {
                buffer.Add(reader.Line);
                reader.ReadLine();
            }

            var admonition = new Admonition(match.Groups["style"].Value.ToEnum <AdmonitionStyle>());

            admonition.Attributes.Add(attributes);
            ProcessParagraph(admonition, ref buffer);
            container.Add(admonition);
            attributes = null;

            reader.ReadLine();
        }
예제 #2
0
 /// <summary>
 /// Visits the admonition.
 /// </summary>
 /// <param name="admonition">The admonition.</param>
 public virtual void VisitAdmonition(Admonition admonition)
 {
     // TODO: Handle admonition block
     if (admonition == null)
     {
         return;
     }
     _writer.Write("{0}: ", admonition.Style.ToString().ToUpperInvariant());
     VisitContainer(admonition);
 }
예제 #3
0
 /// <summary>
 /// Visits the admonition.
 /// </summary>
 /// <param name="admonition">The admonition.</param>
 public virtual void VisitAdmonition(Admonition admonition)
 {
     VisitAttributable(admonition);
     VisitContainer(admonition);
 }
예제 #4
0
 public virtual void Visit(Admonition admonition)
 {
 }