@Test public void generateUnorderedList() { final String result = markup.convertAsHtml("* One\n* Two"); assertEquals("<ul><li>One</li><li>Two</li></ul>", result); }
@Override public String convertAsHtml(String markupString) { if (markupString == null) throw new IllegalArgumentException("Can not convert " + getName() + " to HTML : the String is null"); String result = null; try (final StringWriter writer = new StringWriter()) { final DocumentBuilder builder = new HtmlDocumentBuilder(writer); final MarkupParser parser = new MarkupParser(new TextileLanguage(), builder); parser.parse(markupString, false); builder.flush(); writer.flush(); result = writer.toString(); } catch (IOException e) { LOGGER.log(Level.WARNING, "Error while converting to textile"); } return result; }
TextileMarkup extends AbstractMarkup { @Override public String convertAsHtml(String markupString) { if (markupString == null) throw new IllegalArgumentException("Can not convert " + getName() + " to HTML : the String is null"); String result = null; try (final StringWriter writer = new StringWriter()) { final DocumentBuilder builder = new HtmlDocumentBuilder(writer); final MarkupParser parser = new MarkupParser(new TextileLanguage(), builder); parser.parse(markupString, false); builder.flush(); writer.flush(); result = writer.toString(); } catch (IOException e) { LOGGER.log(Level.WARNING, "Error while converting to textile"); } return result; } }
TextileMarkup extends AbstractMarkup { @Override public String convertAsHtml(String markupString) { if (markupString == null) throw new IllegalArgumentException("Can not convert " + getName() + " to HTML : the String is null"); String result = null; try (final StringWriter writer = new StringWriter()) { final DocumentBuilder builder = new HtmlDocumentBuilder(writer); final MarkupParser parser = new MarkupParser(new TextileLanguage(), builder); parser.parse(markupString, false); builder.flush(); writer.flush(); result = writer.toString(); } catch (IOException e) { LOGGER.log(Level.WARNING, "Error while converting to textile"); } return result; } TextileMarkup(); }
TextileMarkup extends AbstractMarkup { @Override public String convertAsHtml(String markupString) { if (markupString == null) throw new IllegalArgumentException("Can not convert " + getName() + " to HTML : the String is null"); String result = null; try (final StringWriter writer = new StringWriter()) { final DocumentBuilder builder = new HtmlDocumentBuilder(writer); final MarkupParser parser = new MarkupParser(new TextileLanguage(), builder); parser.parse(markupString, false); builder.flush(); writer.flush(); result = writer.toString(); } catch (IOException e) { LOGGER.log(Level.WARNING, "Error while converting to textile"); } return result; } TextileMarkup(); @Override String convertAsHtml(String markupString); }
TextileMarkup extends AbstractMarkup { @Override public String convertAsHtml(String markupString) { if (markupString == null) throw new IllegalArgumentException("Can not convert " + getName() + " to HTML : the String is null"); String result = null; try (final StringWriter writer = new StringWriter()) { final DocumentBuilder builder = new HtmlDocumentBuilder(writer); final MarkupParser parser = new MarkupParser(new TextileLanguage(), builder); parser.parse(markupString, false); builder.flush(); writer.flush(); result = writer.toString(); } catch (IOException e) { LOGGER.log(Level.WARNING, "Error while converting to textile"); } return result; } TextileMarkup(); @Override String convertAsHtml(String markupString);  }