Inheritance: ContainerBlock
コード例 #1
0
 public virtual void Visit(FencedCode code)
 {
     var language = code.InfoWords.FirstOrDefault();
     var attributes = new List<Attribute>();
     if (!string.IsNullOrEmpty(language))
     {
         attributes.Add(new Attribute("class", "language-" + language));
     }
     WriteStartTag(code, "pre");
     WriteStartTag(code, "code", attributes);
     WriteEscaped(code.Contents);
     WriteEndTag(code, "code");
     WriteEndTag(code, "pre");
     WriteLine();
 }
コード例 #2
0
 public virtual void Visit(List list)
 {
     _inTightList.Push(list.Tight);
     var tag = list.Data.Type == "Bullet" ? "ul" : "ol";
     var attributes = new List<Attribute>();
     if (list.Data.Start != null && list.Data.Start != 1)
     {
         attributes.Add(new Attribute("start", list.Data.Start.ToString()));
     }
     WriteStartTag(list, tag, attributes);
     Write(list.Children);
     WriteEndTag(list, tag);
     if (!(list.Parent is ListItem))
     {
         WriteLine();
     }
     _inTightList.Pop();
 }