public class HtmlStringToWikiTranslator extends Object
Constructor and Description |
---|
HtmlStringToWikiTranslator()
Create a new translator.
|
Modifier and Type | Method and Description |
---|---|
static String |
element2String(org.jdom2.Element element)
A static helper method to create HTML from an Element.
|
String |
translate(String html)
Translates text from HTML into WikiMarkup without a WikiContext (meaning
some things perhaps cannot be translated).
|
String |
translate(String html,
WikiContext wikiContext)
Translates text from HTML into WikiMarkup with a WikiContext.
|
String |
translate(String html,
XHtmlToWikiConfig config)
Translates text from HTML into WikiMarkup using a specified configuration.
|
public HtmlStringToWikiTranslator()
public String translate(String html) throws org.jdom2.JDOMException, IOException
html
- HTML text to translateorg.jdom2.JDOMException
- If parsing failsIOException
- For other kinds of errors.public String translate(String html, WikiContext wikiContext) throws org.jdom2.JDOMException, IOException
html
- HTML text to translatewikiContext
- The WikiContext to use.org.jdom2.JDOMException
- If parsing failsIOException
- For other kinds of errors.public String translate(String html, XHtmlToWikiConfig config) throws org.jdom2.JDOMException, IOException
html
- HTML text to translateconfig
- The configuration to use.org.jdom2.JDOMException
- If parsing failsIOException
- For other kinds of errors.public static String element2String(org.jdom2.Element element)
element
- The element to get HTML from.Copyright © 2001-2019 The Apache Software Foundation. All rights reserved.