Package br.com.caelum.tubaina.parser

Examples of br.com.caelum.tubaina.parser.SimpleIndentator


  public String parseImage(String text, String options) {
    return new ImageTag().parse(text, options);
  }

  public String parseJava(String text, String options) {
    String string = new JavaTag(new SimpleIndentator()).parse(text, options);
    return string;
  }
View Full Code Here


    return this.parse(string);
  }

  public String parseCode(String text, String options) {
    text = this.sanitizer.sanitize(text);
    return new CodeTag(new SimpleIndentator()).parse(text, options);
  }
View Full Code Here

    return new ListTag().parse(text, options);
  }

  public String parseXml(String text, String options) {
    text = this.sanitizer.sanitize(text);
    String string = new XmlTag(new SimpleIndentator()).parse(text, options);
    return string;
  }
View Full Code Here

  public String parseImage(String text, String options) {
    return new ImageTag().parse(text, options);
  }

  public String parseJava(String text, String options) {
    String string = new JavaTag(new SimpleIndentator()).parse(text, options);
    return VSPACE + string;
  }
View Full Code Here

    text = parse(text);
    return new ParagraphTag().parse(text, null);
  }

  public String parseCode(String text, String options) {
    String string = new CodeTag(new SimpleIndentator()).parse(text, options);
    return VSPACE + string + VSPACE;
  }
View Full Code Here

    String string = new ListTag().parse(text, options);
    return string;
  }

  public String parseXml(String text, String options) {
    return VSPACE + new XmlTag(new SimpleIndentator()).parse(text, options) + VSPACE;
  }
View Full Code Here

    @SuppressWarnings("unused")
    // code to be retrieved, we can only assert parts of it
    String gistedCode = "javascript:(function() {window.frames[3][0].document.getElementById('frameplugin').style.display='none'})()";

    GistChunk chunk = new GistChunk(options);
    String output = new GistTag(new SimpleIndentator(4), retriever).parse(chunk);

    assertPygmentsRan(output);
    assertTrue(output.contains("javascript"));
    assertTrue(output.contains("function"));
  }
View Full Code Here

    GistConnector connector = new GistConnector(new JsonToGistResultConverter(), mockedGistRequest);

    GistResultRetriever retriever = new GistResultRetriever(connector);

    GistChunk chunk = new GistChunk(options);
    String output = new GistTag(new SimpleIndentator(4), retriever).parse(chunk);

    assertPygmentsRan(output);
    assertTrue(output.contains("GivenCode"));
  }
View Full Code Here

@Deprecated
public class RubyTagTest extends AbstractTagTest {
 
  @Test(expected=Exception.class)
  public void tagIsDeprecatedAndParsingAgainstItWillAlwaysThrowAnException() {
    RubyTag rubyTag = new RubyTag(new SimpleIndentator(4));
    String code = "# this is a ruby comment";
    RubyChunk chunk = new RubyChunk(code, "");
    rubyTag.parse(chunk);
  }
View Full Code Here

  public String parse(CodeChunk chunk) {
    String options = chunk.getOptions();
    String language = detectLanguage(options);
    List<Integer> highlights = detectHighlights(options);
    boolean numbered = options.contains("#");
    SimpleIndentator simpleIndentator = new SimpleIndentator(2);
    String indentedCode = simpleIndentator.indent(chunk.getContent());
    String label = matchLabel(options);
    String pygmentsOptions = codeTagOptionsParser.parsePygmentsOptions(options);

    String code = htmlCodeHighlighter.highlight(indentedCode, language, numbered, highlights, pygmentsOptions);
View Full Code Here

TOP

Related Classes of br.com.caelum.tubaina.parser.SimpleIndentator

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.