Package info.bliki.html

Examples of info.bliki.html.HTML2WikiConverter


    String result = conv.toWiki(new ToJSPWiki(true, true));
    assertEquals(result, "");
  }

  public void test12() {
    HTML2WikiConverter conv = new HTML2WikiConverter();
    conv.setInputHTML("<b> </b> <em> </em>");
    String result = conv.toWiki(new ToJSPWiki());
    assertEquals(result, "   ");
  }
View Full Code Here


    String result = conv.toWiki(new ToJSPWiki());
    assertEquals(result, "   ");
  }

  public void test13() {
    HTML2WikiConverter conv = new HTML2WikiConverter();
    conv.setInputHTML("<div> </div>");
    String result = conv.toWiki(new ToJSPWiki());
    assertEquals(result, " ");
  }
View Full Code Here

    String result = conv.toWiki(new ToJSPWiki());
    assertEquals(result, " ");
  }

  public void test14() {
    HTML2WikiConverter conv = new HTML2WikiConverter();
    // invalid nested html test
    conv
        .setInputHTML("<h2>the <a href=\"http://good\">good</a></h2><h3>the <div>bad</div></h3><h2>and <b><i>the</i> ugly</b></h2>");
    String result = conv.toWiki(new ToJSPWiki());
    assertEquals(result, "\n" +
        "!!!the good\n" +
        "\n" +
        "!!the bad\n" +
        "\n" +
View Full Code Here

        "!!!and the ugly\n" +
        "");
  }

  public void test15() {
    HTML2WikiConverter conv = new HTML2WikiConverter();
    // invalid nested html test
    conv.setInputHTML("The <a href=\"http://good\">good</a> the <div>bad</div> and <b><i>the</i> ugly</b>");
    String result = conv.toWiki(new ToJSPWiki());
    assertEquals(result, "The [good] the bad and __\'\'the\'\' ugly__");
  }
View Full Code Here

    assertEquals(result, "The [good] the bad and __\'\'the\'\' ugly__");
  }

  public static void main(String[] args) {
    try {
      HTML2WikiConverter conv = new HTML2WikiConverter();
      conv.setInputHTML("<b>hello</b> <em>world</em>");
      System.out.print(conv.toWiki(new ToJSPWiki()));

    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

  public HTML2WikipediaTest(String name) {
    super(name);
  }

  public void test0() {
    HTML2WikiConverter conv = new HTML2WikiConverter();
    conv.setInputHTML("<b>hello<em>world</em></b>");
    String result = conv.toWiki(new ToWikipedia());
    assertEquals(result, "'''hello''world'''''");
  }
View Full Code Here

  public HTML2MoinMoinTest(String name) {
    super(name);
  }

  public void test0() {
    HTML2WikiConverter conv = new HTML2WikiConverter();
    conv.setInputHTML("<b>hello<em>world</em></b>");
    String result = conv.toWiki(new ToMoinMoin());
    assertEquals(result, "'''hello''world'''''");
  }
View Full Code Here

    String result = conv.toWiki(new ToWikipedia());
    assertEquals(result, "'''hello''world'''''");
  }

  public void test1() {
    HTML2WikiConverter conv = new HTML2WikiConverter();
    conv.setInputHTML("<ul><li>hello world<ol><li>hello subworld</li></ol></li><li>second line</li></ul>");
    String result = conv.toWiki(new ToWikipedia());
    assertEquals(result, "\n* hello world\n" + "*# hello subworld\n" + "* second line\n");
  }
View Full Code Here

    String result = conv.toWiki(new ToMoinMoin());
    assertEquals(result, "'''hello''world'''''");
  }

  public void test1() {
    HTML2WikiConverter conv = new HTML2WikiConverter();
    conv
        .setInputHTML("<ul><li>hello world<ol><li>hello subworld1<ul><li>sub sub test1</li>\n<li>sub sub test2</li></ul></li><li>hello subworld2</li></ol></li><li>second line</li></ul>");
    String result = conv.toWiki(new ToMoinMoin());
    assertEquals(result, "\n" + "* hello world\n" + " 1. hello subworld1\n" + "  * sub sub test1\n"
        + "  * sub sub test2\n" + " 1. hello subworld2\n" + "* second line\n" + "");
  }
View Full Code Here

    assertEquals(result, "\n" + "* hello world\n" + " 1. hello subworld1\n" + "  * sub sub test1\n"
        + "  * sub sub test2\n" + " 1. hello subworld2\n" + "* second line\n" + "");
  }

  public void test2() {
    HTML2WikiConverter conv = new HTML2WikiConverter();
    // invalid nested html test
    conv.setInputHTML("<ul><li>hello world<ol><li>hello subworld</ol><li>second line</ul>");
    String result = conv.toWiki(new ToMoinMoin());
    assertEquals(result, "\n" + "* hello world\n" + " 1. hello subworld\n" + "* second line\n" + "");
  }
View Full Code Here

TOP

Related Classes of info.bliki.html.HTML2WikiConverter

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.