Interface HTMLConverter


  • @Role
    public interface HTMLConverter
    Converts HTML to/from a specified syntax.
    Version:
    $Id: 1242cdc148c77c1c6e71b237057b01e1a4894611 $
    • Method Detail

      • toHTML

        @Deprecated
        String toHTML​(String source,
                      String syntaxId)
        Deprecated.
        since 11.9RC1, use toHTML(String, Syntax, EntityReference) instead
        Converts the given source text from the specified syntax to HTML.
        Parameters:
        source - the text to be converted
        syntaxId - the syntax of the source
        Returns:
        the HTML result of the conversion
      • toHTML

        default String toHTML​(String source,
                              org.xwiki.rendering.syntax.Syntax syntax,
                              EntityReference sourceReference)
        Converts the given source text from the specified syntax to HTML.
        Parameters:
        source - the text to be converted
        syntax - the syntax of the source
        sourceReference - the reference of the source
        Returns:
        the HTML result of the conversion
        Since:
        11.9RC1
      • toHTML

        @Unstable
        default String toHTML​(String source,
                              org.xwiki.rendering.syntax.Syntax syntax,
                              EntityReference sourceReference,
                              boolean restricted)
        Converts the given source text from the specified syntax to HTML.
        Parameters:
        source - the text to be converted
        syntax - the syntax of the source
        sourceReference - the reference of the source
        restricted - true if the content of this property should be executed in a restricted content, false otherwise
        Returns:
        the HTML result of the conversion
        Since:
        14.10, 14.4.7, 13.10.11
      • fromHTML

        String fromHTML​(String html,
                        String syntaxId)
        Cleans and converts the given HTML fragment to the specified syntax.
        Parameters:
        html - the HTML text to be converted
        syntaxId - the syntax identifier
        Returns:
        the result on the conversion
      • parseAndRender

        @Deprecated
        String parseAndRender​(String html,
                              String syntax)
        Deprecated.
        Parses the given HTML fragment and renders the result in annotated XHTML syntax.
        Parameters:
        html - the HTML fragment to be parsed and rendered
        syntax - the storage syntax
        Returns:
        the XHTML result of rendering the given HTML fragment
      • parseAndRender

        default String parseAndRender​(String html,
                                      org.xwiki.rendering.syntax.Syntax syntax,
                                      EntityReference sourceReference)
        Parses the given HTML fragment and renders the result in annotated XHTML syntax.
        Parameters:
        html - the HTML fragment to be parsed and rendered
        syntax - the storage syntax
        sourceReference - the reference of the html (where it's coming from)
        Returns:
        the XHTML result of rendering the given HTML fragment
        Since:
        11.9RC1
      • parseAndRender

        @Unstable
        default String parseAndRender​(String html,
                                      org.xwiki.rendering.syntax.Syntax syntax,
                                      EntityReference sourceReference,
                                      boolean restricted)
        Parses the given HTML fragment and renders the result in annotated XHTML syntax.
        Parameters:
        html - the HTML fragment to be parsed and rendered
        syntax - the storage syntax
        sourceReference - the reference of the html (where it's coming from)
        restricted - true if the content of this property should be executed in a restricted content, false otherwise
        Returns:
        the XHTML result of rendering the given HTML fragment
        Since:
        14.10, 14.4.7, 13.10.11