if (dialect.isEmptyLine(line)) {
setClosed(true);
return 0;
}
TextileDialect dialect = (TextileDialect) getDialect();
// NOTE: in Textile paragraphs can have nested lists and other things, however
// the resulting XHTML is invalid -- so here we allow for similar constructs
// however we cause them to end the paragraph rather than being nested.
for (Block block: dialect.getParagraphBreakingBlocks()) {
if (block.canStart(line, offset)) {
setClosed(true);
return 0;
}
}
if (blockLineCount != 0) {
if (unwrapped) {
builder.characters("\n");
} else {
builder.lineBreak();
}
}
++blockLineCount;
dialect.emitMarkupLine(getParser(),state,line, offset);
return -1;
}