Smart.Framework Logo

final class \SmartPMarkdownToHTML
{ } ->

Class: SmartPMarkdownToHTML - Render (classic) Markdown Code to HTML Code.
Parsedown by Emanuil Rusev, License: MIT
This supports the classic markdown (v1) version which lacks many features ...
For a full featured markdown parser use the class SmartMarkdownToHTML !
The class SmartMarkdownToHTML compared with this one is:
+ more stable and secure, all html syntax is escaped by standards, no particular need to post-validate the html after rendering
+ no need for extra HTML validation which in the case of SmartPMarkdownToHTML is needed by default to be quite safe ... and will take up to 1.8 MB extra memory and a plus of 0.08 seconds in execution
+ features full v2 syntax support (smart flavour) like: highlight, underline, insert, delete, flexboxs, divs, supports full mixing of lists ul with ol with no restrictions, and more ...
+ v2 also includes support for blockquote blocks '<<<' which can support inside all the other syntax
+ the code in blocks or inline does not need to be escaped at all, as-is as renders by using protect blocks feature


class Methods

public function __construct ( bool $y_breaksEnabled = true, bool $y_sBreakEnabled = true, bool $y_urlsLinked = true, bool $y_htmlEntitiesDisabled = false, $y_validateHtml = true, string $y_relative_url_prefix = null, bool $y_use_all_unveil = false ) {} @ 
Class constructor with many options
public function parse ( STRING $text ) {} -> STRING
@return: {STRING} HTML code
@param: {STRING} $text: The Markdown to be processed
Converts Markdown to HTML

class Properties


class Constants


Sample code: PHP

<?php

$markdown 
= new SmartPMarkdownToHTML();
 
$html $markdown->parse('Hello **SmartPMarkdownToHTML** !');
 
// $html would be: '<p>Hello <b>SmartPMarkdownToHTML</b> !</p>'

// #end php code


documentation generated on: 2023-10-19 23:15:56 +0000


Smart.Framework © 2009-2023 unix-world.org