Package info.bliki.html.jspwiki

Examples of info.bliki.html.jspwiki.ToJSPWiki


  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


  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 class HTML2JSPWikiTest {
    @Test public void test0() {
        HTML2WikiConverter conv = new HTML2WikiConverter();
        conv.setInputHTML("<b>hello<em>world</em></b>");
        String result = conv.toWiki(new ToJSPWiki());
        assertThat("__hello''world''__").isEqualTo(result);
    }
View Full Code Here

    @Test 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 ToJSPWiki());
        assertThat("\n" + "* hello world\n" + " # hello subworld1\n" + "  * sub sub test1\n" + "  * sub sub test2\n"
                + " # hello subworld2\n" + "* second line\n" + "").isEqualTo(result);
    }
View Full Code Here

    @Test 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 ToJSPWiki());
        assertThat("\n" + "* hello world\n" + " # hello subworld\n" + "* second line\n" + "").isEqualTo(result);
    }
View Full Code Here

    @Test public void test3() {
        HTML2WikiConverter conv = new HTML2WikiConverter();
        // invalid nested html test
        conv.setInputHTML("<h2>the good</h2><h3>the bad</h3><h4>and the ugly</h4>");
        String result = conv.toWiki(new ToJSPWiki());
        assertThat("\n" +
                "!!!the good\n" +
                "\n" +
                "!!the bad\n" +
                "\n" +
View Full Code Here

                + "<td>Strauße (Struthionidae)</td>\n" + "</tr>\n" + "\n" + "<tr>\n"
                + "<td><i><a href=\"/wiki/Gattung_%28Biologie%29\" title=\"Gattung (Biologie)\">Gattung</a>:</i></td>\n"
                + "<td>Strauße (<i>Struthio</i>)</td>\n" + "</tr>\n" + "<tr>\n"
                + "<td><i><a href=\"/wiki/Art_%28Biologie%29\" title=\"Art (Biologie)\">Art</a>:</i></td>\n"
                + "<td>Afrikanischer Strauß</td>\n" + "</tr>\n" + "</table>");
        String result = conv.toWiki(new ToJSPWiki());
        assertThat("                         \n" +
                "|''[Klasse]:''|[Vögel] (Aves)\n" +
                "|''[Unterklasse]:''|[Urkiefervögel] (Palaeognathae)\n" +
                "|''[Ordnung]:''|[Laufvögel] (Struthioniformes)\n" +
                "|''[Familie]:''|Strauße (Struthionidae)\n" +
View Full Code Here

    }

    @Test public void test6() {
        HTML2WikiConverter conv = new HTML2WikiConverter();
        conv.setInputHTML("<b>hello</b> <em>world</em>");
        String result = conv.toWiki(new ToJSPWiki());
        assertThat("__hello__ ''world''").isEqualTo(result);
    }
View Full Code Here

    }

    @Test public void test7() {
        HTML2WikiConverter conv = new HTML2WikiConverter();
        conv.setInputHTML("<html><body><table>\n<tr>\n<td>hello world</td>\n</tr></table></body></html>");
        String result = conv.toWiki(new ToJSPWiki());
        assertThat("   \n" +
                "|hello world\n" +
                "").isEqualTo(result);
    }
View Full Code Here

    }

    @Test public void test8() {
        HTML2WikiConverter conv = new HTML2WikiConverter();
        conv.setInputHTML("<font size=\"1\">hello</font> <em>world</em>");
        String result = conv.toWiki(new ToJSPWiki(true, true));
        assertThat("hello ''world''").isEqualTo(result);
    }
View Full Code Here

TOP

Related Classes of info.bliki.html.jspwiki.ToJSPWiki

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.