setClosed(true);
return 0;
}
MediaWikiDialect dialect = (MediaWikiDialect) getDialect();
// paragraphs can have nested lists and other things
for (Block block: dialect.getParagraphBreakingBlocks()) {
if (block.canStart(line, offset)) {
setClosed(true);
return 0;
}
}
++blockLineCount;
if (nestedBlock != null) {
if (blockLineCount > 1) {
builder.lineBreak();
}
nestedBlock.processLine(line, offset);
} else {
if (offset == 0 && line.length() > 0 && line.charAt(0) == ' ') {
// a preformatted block.
setClosed(true);
return 0;
}
if (blockLineCount != 1) {
// note: newlines don't automatically convert to line breaks
builder.characters("\n");
}
dialect.emitMarkupLine(getParser(),state,line, offset);
}
return -1;
}