Example #1
0
 /// <summary>
 /// Visits the section title.
 /// </summary>
 /// <param name="sectionTitle">The section title.</param>
 public virtual void VisitSectionTitle(SectionTitle sectionTitle)
 {
     if (sectionTitle == null)
     {
         return;
     }
     VisitAttributeList(sectionTitle.Attributes);
     _writer.Write("{0} ", new string('=', sectionTitle.Level));
     VisitInlineContainer(sectionTitle);
     _writer.WriteLine();
     _writer.WriteLine();
 }
Example #2
0
        // TODO: based on html output, a section title should define a section block element into which all proceeding elements should be added, until the next section Title is hit
        public override void InternalParse(Container container, IDocumentReader reader, Func <string, bool> predicate, ref List <string> buffer,
                                           ref AttributeList attributes)
        {
            var match = PatternMatcher.SectionTitle.Match(reader.Line);

            if (!match.Success)
            {
                throw new ArgumentException("not a section title");
            }

            var title          = match.Groups["title"].Value;
            var inlineElements = ProcessInlineElements(title);
            var level          = match.Groups["level"].Value.Length;
            var sectionTitle   = new SectionTitle(inlineElements, level);

            sectionTitle.Attributes.Add(attributes);
            container.Add(sectionTitle);
            attributes = null;

            reader.ReadLine();
        }
Example #3
0
 /// <summary>
 /// Visits the section title.
 /// </summary>
 /// <param name="sectionTitle">The section title.</param>
 public virtual void VisitSectionTitle(SectionTitle sectionTitle)
 {
     VisitInlineContainer(sectionTitle);
 }
Example #4
0
 public virtual void Visit(SectionTitle sectionTitle)
 {
 }
Example #5
0
 public virtual void Visit(SectionTitle sectionTitle)
 {
     Visit((InlineContainer)sectionTitle);
 }
Example #6
0
 protected bool Equals(SectionTitle other)
 {
     return(_level == other._level &&
            Attributes.Equals(other.Attributes) &&
            Elements.SequenceEqual(other.Elements));
 }