Details
-
Bug
-
Resolution: Fixed
-
Major
-
3.0 M1
-
None
-
Unit
-
Unknown
-
Description
I'm using this code to convert xhtml/1.0 to xwiki/2.0:
StreamParser xhtmlStreamParser = componentManager.lookup(StreamParser.class, "xhtml/1.0"); WikiPrinter printer = new DefaultWikiPrinter(); PrintRendererFactory printRendererFactory = componentManager.lookup(PrintRendererFactory.class, "xwiki/2.0"); xhtmlStreamParser.parse(new StringReader(xhtml), printRendererFactory.createRenderer(printer));
Some of the content, mostly from the end, is lost during the conversion. For instance this:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html><head></head><body><p>one <strong>two</strong> <em>three</em></p></body></html>
is converted to:
one **two** //
Attachments
Issue Links
- blocks
-
XWIKI-5025 Use streaming renderer and parser APIs to convert from HTML to wiki syntax
- Closed