Class EditorBbcodeService

java.lang.Object
fr.paris.lutece.portal.service.editor.EditorBbcodeService
All Implemented Interfaces:
IEditorBbcodeService

@ApplicationScoped public class EditorBbcodeService extends Object implements IEditorBbcodeService
This class Provides a parser BBCODE
  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use @Inject to obtain the EditorBbcodeService instance.
    parse(String strValue)
    Parse BBCODE text and return safe HTML This method clean a body fragment of HTML with Safelist.basicWithImages()
    parseAndClean(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.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • parse

      public String parse(String strValue)
      Parse BBCODE text and return safe HTML This method clean a body fragment of HTML with Safelist.basicWithImages()
      Specified by:
      parse in interface IEditorBbcodeService
      Parameters:
      strValue - the value of the text
      Returns:
      HTML Text
    • parseAndClean

      public String parseAndClean(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:
      parseAndClean in interface IEditorBbcodeService
      Parameters:
      strValue - the input string to be parsed and cleaned
      safelist - the Safelist to be used for cleaning the HTML
      Returns:
      the cleaned and sanitized string
    • getInstance

      @Deprecated(since="8.0", forRemoval=true) public static IEditorBbcodeService getInstance()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use @Inject to obtain the EditorBbcodeService instance. This method will be removed in future versions.
      Returns the unique instance of the EditorBbcodeService service.

      This method is deprecated and is provided for backward compatibility only. For new code, use dependency injection with @Inject to obtain the EditorBbcodeService instance instead.

      Returns:
      The unique instance of EditorBbcodeService.