Package net.java.textilej.parser.markup.mediawiki

Examples of net.java.textilej.parser.markup.mediawiki.MediaWikiDialect


      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;
  }
View Full Code Here


  private static class ThreadLocalMediaWikiProcessor extends ThreadLocal<MarkupParser> {

    @Override
    protected MarkupParser initialValue() {

      return new MarkupParser(new MediaWikiDialect());

    }
View Full Code Here

TOP

Related Classes of net.java.textilej.parser.markup.mediawiki.MediaWikiDialect

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.