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: 563184d36a55817b16fc671c0eb1428d04979a82 $
  • Constructor Details

    • ParserUtils

      public ParserUtils()
  • Method Details

    • 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

      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 convert
      preserveXDOM - true of the XDOM should be returned
      Returns:
      the inline version of the passed block
      Since:
      14.0RC1
    • convertToInline

      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