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: 4af96adf4c2e52e70b3dba0694c7271eb6071c69 $
-
-
Constructor Summary
Constructors Constructor Description ParserUtils()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
convertToInline(List<Block> blocks)
Make its best to convert a passed blocks to their inline version.Block
convertToInline(Block rootBlock, boolean preserveXDOM)
Make its best to convert a passed block to its inline version.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}}
.
-
-
-
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
-
-