Confluence 2.7 Temp Archive : How do I convert wiki text to HTML?
This page last changed on Oct 07, 2007 by smaddox.
Cannot resolve external resource into attachment. How do I convert wiki text to HTML?This depends on where you want to do it: In a macro...You will need the SubRenderer (see how to retrieve it). The SubRenderer has two render methods: one that allows you to specify a specific RenderMode for the rendered content, and another that uses the current RenderMode from the RenderContext.
In some other component...You will need the WikiStyleRenderer (see how to retrieve a component). The WikiStyleRenderer has a convertWikiToHtml method that takes the wiki text you wish to convert, and a RenderContext. If you are converting the text in the context of some ContentEntityObject (for example within a page or blog post), then you can call contentEntityObject.toPageContext() to retrieve its RenderContext. Otherwise pass in a new PageContext(). |
![]() |
Document generated by Confluence on Dec 20, 2007 19:02 |