34.2 TO_HTML Function

This function converts a Markdown string into HTML.

Syntax

APEX_MARKDOWN.TO_HTML (
    p_markdown              IN CLOB,
    p_embedded_html_mode    IN t_embedded_html_mode DEFAULT c_embedded_html_escape,
    p_softbreak             IN VARCHAR2             DEFAULT '<br />',
    p_extra_link_attributes IN apex_t_varchar2      DEFAULT apex_t_varchar2() )
    RETURN CLOB;

Parameters

Table 34-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 is 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 apex_application.LF. If none is specified, uses <br />.
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;