Package org.pegdown

Examples of org.pegdown.LinkRenderer


public class MarkdownToDoxiaHtmlSerializer
    extends ToHtmlSerializer
{
    public MarkdownToDoxiaHtmlSerializer()
    {
        super( new LinkRenderer() );
    }
View Full Code Here


    html.append("<style type=\"text/css\">\n")
        .append(readCSS())
        .append("\n</style>");
    html.append("</head>");
    html.append("<body>\n");
    html.append(new ToHtmlSerializer(new LinkRenderer()).toHtml(root));
    html.append("\n</body></html>");
    return html.toString().getBytes(charEnc);
  }
View Full Code Here

   */
  public static String transformMarkdown(String markdown, LinkRenderer linkRenderer) {
    try {
      PegDownProcessor pd = new PegDownProcessor(ALL & ~SMARTYPANTS);
      RootNode astRoot = pd.parseMarkdown(markdown.toCharArray());
      return new WorkaroundHtmlSerializer(linkRenderer == null ? new LinkRenderer() : linkRenderer).toHtml(astRoot);
    } catch (ParsingTimeoutException e) {
      return null;
    }
  }
View Full Code Here

   * @param doc
   * @param repositoryName
   * @param commitId
   */
  private void parse(final MarkupDocument doc, final String repositoryName, final String commitId) {
    LinkRenderer renderer = new LinkRenderer() {

      @Override
      public Rendering render(ExpImageNode node, String text) {
        if (node.url.indexOf("://") == -1) {
          // repository-relative image link
View Full Code Here

   */
  public static String transformMarkdown(String markdown, LinkRenderer linkRenderer) {
    try {
      PegDownProcessor pd = new PegDownProcessor(ALL & ~SMARTYPANTS);
      RootNode astRoot = pd.parseMarkdown(markdown.toCharArray());
      return new WorkaroundHtmlSerializer(linkRenderer == null ? new LinkRenderer() : linkRenderer).toHtml(astRoot);
    } catch (ParsingTimeoutException e) {
      return null;
    }
  }
View Full Code Here

   * @param doc
   * @param repositoryName
   * @param commitId
   */
  private void parse(final MarkupDocument doc, final String repositoryName, final String commitId) {
    LinkRenderer renderer = new LinkRenderer() {

      @Override
      public Rendering render(ExpImageNode node, String text) {
        if (node.url.indexOf("://") == -1) {
          // repository-relative image link
View Full Code Here

                bodyText = htmlSerializer.toHtml(rootNode);
            }
            else {
                RootNode rootNode = markdownProcessor.parseMarkdown(sourceText.toCharArray());
                final ExportSerializer htmlSerializer
                        = new ExportSerializer(new LinkRenderer());
                bodyText = htmlSerializer.toHtml(rootNode);
            }
        }
        catch (ParsingTimeoutException ex) {
            throw new IOException(ex);
View Full Code Here

   * @return html version of markdown text
   * @throws java.text.ParseException
   */
  public static String transformMarkdown(String markdown, LinkRenderer linkRenderer) {
    PegDownProcessor pd = new PegDownProcessor(ALL & ~SMARTYPANTS);
    String html = pd.markdownToHtml(markdown, linkRenderer == null ? new LinkRenderer() : linkRenderer);
    return html;
  }
View Full Code Here

TOP

Related Classes of org.pegdown.LinkRenderer

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.