Package org.xwiki.rendering.util
Class ParserUtils
- java.lang.Object
-
- org.xwiki.rendering.util.ParserUtils
-
public class ParserUtils extends Object
Methods for helping in parsing.- Since:
- 1.7M1
- Version:
- $Id: cb21bf719095a939945434d4fe4f6aa9a60f7c87 $
-
-
Constructor Summary
Constructors Constructor Description ParserUtils()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconvertToInline(List<Block> blocks)Make its best to convert a passed blocks to their inline version.BlockconvertToInline(Block rootBlock, boolean preserveXDOM)Make its best to convert a passed block to its inline version.voidremoveTopLevelParagraph(List<Block> blocks)Removes any top level paragraph since for example for the following use case we don't want an extra paragraph block:= hello {{velocity}}world{{/velocity}}.
-
-
-
Method Detail
-
removeTopLevelParagraph
public void removeTopLevelParagraph(List<Block> blocks)
Removes any top level paragraph since for example for the following use case we don't want an extra paragraph block:= hello {{velocity}}world{{/velocity}}.- Parameters:
blocks- the blocks to check and convert
-
convertToInline
@Unstable public Block convertToInline(Block rootBlock, boolean preserveXDOM)
Make its best to convert a passed block to its inline version. Sometime it's simply impossible to convert an inline block, in which case it will just be returned as is.- Parameters:
rootBlock- the block to convertpreserveXDOM- true of the XDOM should be returned- Returns:
- the inline version of the passed block
- Since:
- 14.0RC1
-
convertToInline
@Unstable public void convertToInline(List<Block> blocks)
Make its best to convert a passed blocks to their inline version. Sometime it's simply impossible to convert an inline block, in which case it will just be returned as is.- Parameters:
blocks- the blocks to convert- Since:
- 14.0RC1
-
-