PHP code example of djadomi / f3-gfm

1. Go to this page and download the library: Download djadomi/f3-gfm library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

djadomi / f3-gfm example snippets


$gfm = new \Djadomi\F3Gfm;
$html = $gfm->convert('# Hello World');
echo $html;

$f3->set('content', $gfm->convert($markdown));

\Template::instance()->filter('gfm', function($text) {
	return \Djadomi\F3Gfm::instance()->convert($text);
});

$f3->set('GFM_HTML_INPUT', 'escape'); // 'strip' or 'allow' (default: 'escape')
$f3->set('GFM_UNSAFE_LINKS', false); // Allow javascript: links (default: false)
$f3->set('GFM_MAX_NESTING', 100); // Max nesting level (default: 100)
$f3->set('GFM_TABLE_WRAP', false); // Wrap tables in div.gfm-table (default: false)