示例#1
0
文件: XHTML.cs 项目: dlbeer/saraswati
        void EmitBlock()
        {
            var blk = new Block();

            blk.BlockType = depPre > 0 ?
            Block.Type.Preformatted : Block.Type.Paragraph;
            blk.Indent = depBlockquote + depPre + depList;

            if (bulletStart)
            {
            ListEnv env = new ListEnv(ListState.Unordered);

            if (stkList.Count > 0)
            env = stkList.Peek();

            bulletStart = false;

            switch (env.State)
            {
            case ListState.Unordered:
            blk.Prefix = "*";
            break;

            case ListState.Ordered:
            blk.Prefix = XmlConvert.ToString(env.ItemCount) + ".";
            break;

            case ListState.Definition:
            blk.Prefix = "~";
            break;
            }
            }

            consumer.PushBlock(blk);
        }
示例#2
0
 public void PushBlock(Block blk)
 {
     blocks.Add(new BlockRecord(fragments.Count, blk));
 }
示例#3
0
 public void PushBlock(Block blk)
 {
 }
示例#4
0
 public void PushBlock(Block blk)
 {
     next.PushBlock(blk);
 }
示例#5
0
        public void PushBlock(Block blk)
        {
            paraPos = 0;
            paraWidth = targetWidth - blk.Indent * indentPerLevel;

            if (blk.BlockType == Block.Type.Preformatted)
            paraWidth = -1;

            consumer.PushBlock(blk);
        }
示例#6
0
        public void PushBlock(Block blk)
        {
            FlushFragment();

            isPreformatted = (blk.BlockType == Block.Type.Preformatted);
            wantSpace = false;
            blockEmpty = true;

            consumer.PushBlock(blk);
        }
示例#7
0
        public void PushBlock(Block blk)
        {
            if (!lineEmpty)
            consumer.PushFragment(new Fragment() {
            Attr = Fragment.Attributes.NewLine
            });

            if (!blockEmpty)
            consumer.PushFragment(new Fragment() {
            Attr = Fragment.Attributes.NewLine
            });

            blockEmpty = true;
            lineEmpty = true;
            paraPrefix = blk.Prefix;
            paraIndent = indentPerLevel * blk.Indent;

            consumer.PushBlock(blk);
        }
示例#8
0
 public BlockRecord(int fi, Block c)
 {
     FragmentIndex = fi;
     Content = c;
 }