예제 #1
0
 @Test
 public void testEm() throws Exception {
   XdocFactory fac = XdocFactory.eINSTANCE;
   Emphasize emphasize = fac.createEmphasize();
   TextOrMarkup textOrMarkup = fac.createTextOrMarkup();
   TextPart textPart = fac.createTextPart();
   textPart.setText("Testtext_");
   textOrMarkup.getContents().add(textPart);
   emphasize.getContents().add(textOrMarkup);
   String expected = "<em>Testtext_</em>";
   String actual = generator.genText(emphasize).toString();
   assertEquals(expected, actual);
   // and for two paragraphs in one em
   TextOrMarkup textOrMarkup2 = fac.createTextOrMarkup();
   TextPart textPart2 = fac.createTextPart();
   textPart2.setText("more test");
   textOrMarkup2.getContents().add(textPart2);
   emphasize.getContents().add(textOrMarkup2);
   expected =
       "<em>\n"
           + "<p>\n"
           + "Testtext_\n"
           + "</p>\n"
           + "<p>\n"
           + "more test\n"
           + "</p>\n"
           + "</em>";
   actual = generator.genText(emphasize).toString();
   assertEquals(expected, actual);
 }
예제 #2
0
 protected CharSequence _toHtml(final Emphasize it) {
   StringConcatenation _builder = new StringConcatenation();
   _builder.append("<strong>");
   EList<TextOrMarkup> _contents = it.getContents();
   CharSequence _html = this.toHtml(_contents);
   _builder.append(_html, "");
   _builder.append("</strong>");
   return _builder;
 }