Package info.bliki.html

Examples of info.bliki.html.HTML2WikiConverter


    String result = conv.toWiki(new ToWikipedia());
    assertEquals(result, "\n* hello world\n" + "*# hello subworld\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 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, "\n" + "* hello world\n" + " 1. hello subworld\n" + "* second line\n" + "");
  }

  public void test3() {
    HTML2WikiConverter conv = new HTML2WikiConverter();
    // invalid nested html test
    conv.setInputHTML("<h2>the good</h2><h3>the bad</h3><h2>and the ugly</h2>");
    String result = conv.toWiki(new ToMoinMoin());
    assertEquals(result, "\n" + "== the good ==\n" + "\n" + "=== the bad ===\n" + "\n" + "== and the ugly ==\n");
  }
View Full Code Here

    String result = conv.toWiki(new ToWikipedia());
    assertEquals(result, "\n* hello world\n" + "*# hello subworld\n" + "* second line\n");
  }

  public void test3() {
    HTML2WikiConverter conv = new HTML2WikiConverter();
    // invalid nested html test
    conv.setInputHTML("<h2>the good</h2><h3>the bad</h3><h2>and the ugly</h2>");
    String result = conv.toWiki(new ToWikipedia());
    assertEquals(result, "\n" + "== the good ==\n" + "\n" + "=== the bad ===\n" + "\n" + "== and the ugly ==\n");
  }
View Full Code Here

    String result = conv.toWiki(new ToMoinMoin());
    assertEquals(result, "\n" + "== the good ==\n" + "\n" + "=== the bad ===\n" + "\n" + "== and the ugly ==\n");
  }

  public void test4() {
    HTML2WikiConverter conv = new HTML2WikiConverter();
    // invalid nested html test
    conv.setInputHTML("<table>\n" + "<tr>\n"
        + "<td><i><a href=\"/wiki/Klasse_%28Biologie%29\" title=\"Klasse (Biologie)\">Klasse</a>:</i></td>\n"
        + "<td><a href=\"/wiki/V%C3%B6gel\" title=\"Vögel\">Vögel</a> (Aves)</td>\n" + "</tr>\n" + "<tr>\n"
        + "<td><i><a href=\"/wiki/Klasse_%28Biologie%29\" title=\"Klasse (Biologie)\">Unterklasse</a>:</i></td>\n"
        + "<td><a href=\"/wiki/Urkieferv%C3%B6gel\" title=\"Urkiefervögel\">Urkiefervögel</a> (Palaeognathae)</td>\n" + "\n"
        + "</tr>\n" + "<tr>\n"
        + "<td><i><a href=\"/wiki/Ordnung_%28Biologie%29\" title=\"Ordnung (Biologie)\">Ordnung</a>:</i></td>\n"
        + "<td><a href=\"/wiki/Laufv%C3%B6gel\" title=\"Laufvögel\">Laufvögel</a> (Struthioniformes)</td>\n" + "</tr>\n" + "<tr>\n"
        + "<td><i><a href=\"/wiki/Familie_%28Biologie%29\" title=\"Familie (Biologie)\">Familie</a>:</i></td>\n"
        + "<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 ToMoinMoin());
    assertEquals(result, "                         \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

    String result = conv.toWiki(new ToWikipedia());
    assertEquals(result, "\n" + "== the good ==\n" + "\n" + "=== the bad ===\n" + "\n" + "== and the ugly ==\n");
  }

  public void test4() {
    HTML2WikiConverter conv = new HTML2WikiConverter();
    // invalid nested html test
    conv.setInputHTML("<table>\n" + "<tr>\n"
        + "<td><i><a href=\"/wiki/Klasse_%28Biologie%29\" title=\"Klasse (Biologie)\">Klasse</a>:</i></td>\n"
        + "<td><a href=\"/wiki/V%C3%B6gel\" title=\"Vögel\">Vögel</a> (Aves)</td>\n" + "</tr>\n" + "<tr>\n"
        + "<td><i><a href=\"/wiki/Klasse_%28Biologie%29\" title=\"Klasse (Biologie)\">Unterklasse</a>:</i></td>\n"
        + "<td><a href=\"/wiki/Urkieferv%C3%B6gel\" title=\"Urkiefervögel\">Urkiefervögel</a> (Palaeognathae)</td>\n" + "\n"
        + "</tr>\n" + "<tr>\n"
        + "<td><i><a href=\"/wiki/Ordnung_%28Biologie%29\" title=\"Ordnung (Biologie)\">Ordnung</a>:</i></td>\n"
        + "<td><a href=\"/wiki/Laufv%C3%B6gel\" title=\"Laufvögel\">Laufvögel</a> (Struthioniformes)</td>\n" + "</tr>\n" + "<tr>\n"
        + "<td><i><a href=\"/wiki/Familie_%28Biologie%29\" title=\"Familie (Biologie)\">Familie</a>:</i></td>\n"
        + "<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 ToWikipedia());
    assertEquals(result, "                         \n" + "{| border=\"1\"\n" + "|-\n" + "|\'\'[[Klasse]]:\'\'\n" + "|[[Vögel]] (Aves)\n"
        + "|-\n" + "|\'\'[[Unterklasse]]:\'\'\n" + "|[[Urkiefervögel]] (Palaeognathae)\n" + "|-\n" + "|\'\'[[Ordnung]]:\'\'\n"
        + "|[[Laufvögel]] (Struthioniformes)\n" + "|-\n" + "|\'\'[[Familie]]:\'\'\n" + "|Strauße (Struthionidae)\n" + "|-\n"
        + "|\'\'[[Gattung]]:\'\'\n" + "|Strauße (\'\'Struthio\'\')\n" + "|-\n" + "|\'\'[[Art]]:\'\'\n" + "|Afrikanischer Strauß\n"
        + "|}");
View Full Code Here

        "||\'\'[[Art]]:\'\'||Afrikanischer Strauß||\n" +
        "");
  }

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

        + "|\'\'[[Gattung]]:\'\'\n" + "|Strauße (\'\'Struthio\'\')\n" + "|-\n" + "|\'\'[[Art]]:\'\'\n" + "|Afrikanischer Strauß\n"
        + "|}");
  }

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

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

  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 ToMoinMoin());
    assertEquals(result, "   \n" + "||hello world||\n");
  }
View Full Code Here

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

  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 ToWikipedia());
    assertEquals(result, "   \n" + "{| border=\"1\"\n" + "|-\n" + "|hello world\n" + "|}");
  }
View Full Code Here

    String result = conv.toWiki(new ToMoinMoin());
    assertEquals(result, "   \n" + "||hello world||\n");
  }

  public void test8() {
    HTML2WikiConverter conv = new HTML2WikiConverter();
    conv.setInputHTML("<font size=\"1\">hello</font> <em>world</em>");
    String result = conv.toWiki(new ToMoinMoin(true, true));
    assertEquals(result, "hello ''world''");
  }
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.