Class EditorBbcodeService
- java.lang.Object
-
- fr.paris.lutece.portal.service.editor.EditorBbcodeService
-
- All Implemented Interfaces:
IEditorBbcodeService
public class EditorBbcodeService extends java.lang.Object implements IEditorBbcodeService
This class Provides a parser BBCODE
-
-
Constructor Summary
Constructors Constructor Description EditorBbcodeService()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static EditorBbcodeServicegetInstance()Returns the unique instance of the servicevoidinit()Init servicejava.lang.Stringparse(java.lang.String strValue)Parse BBCODE text and return safe HTML This method clean abodyfragment of HTML withSafelist.basicWithImages()java.lang.StringparseAndClean(java.lang.String strValue, org.jsoup.safety.Safelist safelist)Parses the input string using BBCodeUtil.parse() and cleans the resulting HTML using Jsoup.clean() with the specified Safelist, and returns the cleaned string.java.lang.StringparseComment(java.lang.String strValue)Parses a comment as BBCode and sanitizes the generated HTML.
-
-
-
Method Detail
-
parse
public java.lang.String parse(java.lang.String strValue)
Parse BBCODE text and return safe HTML This method clean abodyfragment of HTML withSafelist.basicWithImages()- Specified by:
parsein interfaceIEditorBbcodeService- Parameters:
strValue- the value of the text- Returns:
- HTML Text
-
parseComment
public java.lang.String parseComment(java.lang.String strValue)
Parses a comment as BBCode and sanitizes the generated HTML.- Parameters:
strValue- the comment text- Returns:
- the parsed and sanitized comment
-
parseAndClean
public java.lang.String parseAndClean(java.lang.String strValue, org.jsoup.safety.Safelist safelist)Parses the input string using BBCodeUtil.parse() and cleans the resulting HTML using Jsoup.clean() with the specified Safelist, and returns the cleaned string.- Specified by:
parseAndCleanin interfaceIEditorBbcodeService- Parameters:
strValue- the input string to be parsed and cleanedsafelist- the Safelist to be used for cleaning the HTML- Returns:
- the cleaned and sanitized string
-
getInstance
public static EditorBbcodeService getInstance()
Returns the unique instance of the service- Returns:
- The instance of the service
-
init
public void init()
Init service
-
-