31.2 TO_HTML Function

This function converts a Markdown string into HTML.

Syntax

APEX_MARKDOWN.TO_HTML (
    p_markdown              IN VARCHAR2,
    p_embedded_html_mode    IN t_embedded_html_mode DEFAULT c_embedded_html_escape,
    p_softbreak             IN VARCHAR2             DEFAULT apex_application.LF,
    p_extra_link_attributes IN apex_t_varchar2      DEFAULT apex_t_varchar2() )
    RETURN clob;

Parameters

Table 31-1 TO_HTML Parameters

Parameter Description
p_markdown The Markdown text content to be converted to HTML.
p_embedded_html_mode

Specify what should happen with embedded HTML. By default it will be escaped.

Set this option to C_EMBEDDED_HTML_PRESERVE for it to be preserved. Note that this option has security implications and should only ever be used on trusted input.

p_softbreak Specify a raw string to be used for a softbreak (such as <br />). If none is specified, a line feed will be used.
p_extra_link_attributes A plist of additional HTML attributes for anchor elements. For example, to open all links in new tabs, set this parameter to apex_t_varchar2('target', '_blank')

Example

DECLARE
  l_markdown varchar2(100) := '## APEX_MARKDOWN' || chr(10) || '- Includes the `to_html` **function**';
BEGIN
  dbms_output.put_line(apex_markdown.to_html(l_markdown));
END;