Beispiel #1
0
            protected override bool AggregateCore(ParagraphBlock para, BlockAggregateContext context)
            {
                var next = context.LookAhead(1);

                if (next is ParagraphBlock nextPara)
                {
                    para.Inline.AppendChild(new LineBreakInline());
                    nextPara.Inline.MoveChildrenAfter(para.Inline.LastChild);
                    context.AggregateTo(para, 2);

                    return(true);
                }

                return(false);
            }
Beispiel #2
0
            protected override bool AggregateCore(HeadingBlock headBlock, BlockAggregateContext context)
            {
                if (headBlock.Level == 1)
                {
                    var next = context.LookAhead(1);
                    if (next is ThematicBreakBlock block)
                    {
                        var newBlock = headBlock;
                        newBlock.Level = 2;
                        context.AggregateTo(newBlock, 2);
                        return(true);
                    }
                }

                return(false);
            }