override fun doProcessToken()

in src/commonMain/kotlin/org/intellij/markdown/parser/markerblocks/impl/HtmlBlockMarkerBlock.kt [36:61]


    override fun doProcessToken(pos: LookaheadText.Position, currentConstraints: MarkdownConstraints): MarkerBlock.ProcessingResult {
        if (pos.offsetInCurrentLine != -1) {
            return MarkerBlock.ProcessingResult.CANCEL
        }


        val prevLine = pos.prevLine ?: return MarkerBlock.ProcessingResult.DEFAULT
        if (!constraints.applyToNextLine(pos).extendsPrev(constraints)) {
            return MarkerBlock.ProcessingResult.DEFAULT
        }

        if (endCheckingRegex == null && MarkdownParserUtil.calcNumberOfConsequentEols(pos, constraints) >= 2) {
            return MarkerBlock.ProcessingResult.DEFAULT
        } else if (endCheckingRegex != null && endCheckingRegex.find(prevLine) != null) {
            return MarkerBlock.ProcessingResult.DEFAULT
        }

        if (pos.currentLine.isNotEmpty()) {
            productionHolder.addProduction(listOf(SequentialParser.Node(
                    pos.offset + 1 + constraints.getCharsEaten(pos.currentLine)..pos.nextLineOrEofOffset,
                    MarkdownTokenTypes.HTML_BLOCK_CONTENT)))
        }


        return MarkerBlock.ProcessingResult.CANCEL
    }