Examples of HtmlSanitizer


Examples of br.com.caelum.tubaina.util.HtmlSanitizer

    map.put("curchap", chapterIndex);
    map.put("cursec", sectionIndex);
    map.put("parser", parser);
    map.put("dirTree", dirTree);
    map.put("curdir", currentDir);
    map.put("sanitizer", new HtmlSanitizer());

    return new FreemarkerProcessor(cfg).process(map, "html/section.ftl");
  }
View Full Code Here

Examples of br.com.caelum.tubaina.util.HtmlSanitizer

  public StringBuffer createIndex(final Map<String, Integer> indexes) {
    Map<String, Object> map = new HashMap<String, Object>();
    map.put("dirTree", dirTree);
    map.put("indexes", indexes);
    map.put("sanitizer", new HtmlSanitizer());
    return new FreemarkerProcessor(cfg).process(map, "html/index.ftl");
  }
View Full Code Here

Examples of br.com.caelum.tubaina.util.HtmlSanitizer

    map.put("chapter", c);
    map.put("curchap", index);
    map.put("curdir", currentDir);
    map.put("parser", parser);
    map.put("dirTree", dirTree);
    map.put("sanitizer", new HtmlSanitizer());

    return new FreemarkerProcessor(cfg).process(map, "html/chapter.ftl");
  }
View Full Code Here

Examples of br.com.caelum.tubaina.util.HtmlSanitizer

    Map<String, Object> map = new HashMap<String, Object>();
    map.put("name", b.getName());
    map.put("chapters", b.getChapters());
    map.put("dirTree", dirTree);
    map.put("textbookVersion", new VersionGenerator().generate());
    map.put("sanitizer", new HtmlSanitizer());

    return new FreemarkerProcessor(cfg).process(map, "html/toc.ftl");
  }
View Full Code Here

Examples of br.com.caelum.tubaina.util.HtmlSanitizer

      if (bibliography.isEmpty()) {
        return "";
      }
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("bibliography", bibliography);
        map.put("sanitizer", new HtmlSanitizer());
        return new FreemarkerProcessor(config).process(map, "bibliography.ftl").toString();
       
    }
View Full Code Here

Examples of br.com.caelum.tubaina.util.HtmlSanitizer

  public String parse(SubsectionChunk chunk) {
    int nextSubsection = chunk.getSubsectionNumber();
    int currentChapter = chunk.getCurrentChapter();
    int currentSection = chunk.getCurrentSection();
    ChapterBuilder.getChaptersCount();
    String sanitized = new HtmlSanitizer().sanitize(chunk.getTitle());
    String subsectionTitle = String.format("<" + HTML_TAG + " class='subsection'>%d.%d.%d - %s</" + HTML_TAG + ">", currentChapter, currentSection, nextSubsection, sanitized);
   
    return subsectionTitle + "\n" + chunk.getContent();
  }
View Full Code Here

Examples of br.com.caelum.tubaina.util.HtmlSanitizer

    map.put("curchap", chapterIndex);
    map.put("cursec", sectionIndex);
    map.put("parser", parser);
    map.put("dirTree", dirTree);
    map.put("curdir", currentDir);
    map.put("sanitizer", new HtmlSanitizer());
    map.put("previous", dirTree.get(currentDir - 1));
    if (currentDir+1 < dirTree.size()) {
      map.put("next", dirTree.get(currentDir + 1))
    } else {
      map.put("next", "");
View Full Code Here

Examples of br.com.caelum.tubaina.util.HtmlSanitizer

    map.put("curchap", chapterIndex);
    map.put("cursec", sectionIndex);
    map.put("parser", parser);
    map.put("dirTree", dirTree);
    map.put("curdir", currentDir);
    map.put("sanitizer", new HtmlSanitizer());
    map.put("anchorlink", dirTree.get(currentDir).split("#")[1]);

    return new FreemarkerProcessor(cfg).process(map, "section-flat.ftl");
  }
View Full Code Here

Examples of br.com.caelum.tubaina.util.HtmlSanitizer

  public StringBuffer generateSingleHtmlSection(Section s) {
    Map<String, Object> map = new HashMap<String, Object>();
    map.put("section", s);
    map.put("parser", parser);
    map.put("sanitizer", new HtmlSanitizer());
    return new FreemarkerProcessor(cfg).process(map, "section.ftl");
  }
View Full Code Here

Examples of br.com.caelum.tubaina.util.HtmlSanitizer

  public StringBuffer createIndex(final Map<String, Integer> indexes) {
    Map<String, Object> map = new HashMap<String, Object>();
    map.put("dirTree", dirTree);
    map.put("indexes", indexes);
    map.put("sanitizer", new HtmlSanitizer());
    return new FreemarkerProcessor(cfg).process(map, "index.ftl");
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.