Class BlockStartImpl

    • Field Detail

      • blockParsers

        private final BlockParser[] blockParsers
      • newIndex

        private int newIndex
      • newColumn

        private int newColumn
      • replaceActiveBlockParser

        private boolean replaceActiveBlockParser
      • replaceParagraphLines

        private int replaceParagraphLines
    • Constructor Detail

      • BlockStartImpl

        public BlockStartImpl​(BlockParser... blockParsers)
    • Method Detail

      • getBlockParsers

        public BlockParser[] getBlockParsers()
      • getNewIndex

        public int getNewIndex()
      • getNewColumn

        public int getNewColumn()
      • isReplaceActiveBlockParser

        public boolean isReplaceActiveBlockParser()
      • getReplaceParagraphLines

        int getReplaceParagraphLines()
      • replaceParagraphLines

        public BlockStart replaceParagraphLines​(int lines)
        Description copied from class: BlockStart
        Replace a number of lines from the current paragraph (as returned by MatchedBlockParser.getParagraphLines()) with the new block.

        This is useful for parsing blocks that start with normal paragraphs and only have special marker syntax in later lines, e.g. in this:

         Foo
         ===
         
        The Foo line is initially parsed as a normal paragraph, then === is parsed as a heading marker, replacing the 1 paragraph line before. The end result is a single Heading block.

        Note that source spans from the replaced lines are automatically added to the new block.

        Specified by:
        replaceParagraphLines in class BlockStart
        Parameters:
        lines - the number of lines to replace (at least 1); use Integer.MAX_VALUE to replace the whole paragraph