| 1 |
<?php |
| 2 |
/* |
| 3 |
* License: GPLv3 |
| 4 |
* License URI: https://www.gnu.org/licenses/gpl.txt |
| 5 |
* Copyright 2017-2026 Jean-Sebastien Morisset (https://surniaulula.com/) |
| 6 |
*/ |
| 7 |
|
| 8 |
if ( ! defined( 'ABSPATH' ) ) { |
| 9 |
|
| 10 |
die( 'These aren\'t the droids you\'re looking for.' ); |
| 11 |
} |
| 12 |
|
| 13 |
if ( ! class_exists( 'Michelf\MarkdownExtra' ) ) { |
| 14 |
|
| 15 |
require_once dirname( __FILE__ ) . '/markdown/MarkdownExtra.inc.php'; |
| 16 |
} |
| 17 |
|
| 18 |
/* |
| 19 |
* Provides the SuextMarkdown::transform() method. |
| 20 |
*/ |
| 21 |
if ( ! class_exists( 'SuextMarkdown' ) ) { |
| 22 |
|
| 23 |
class SuextMarkdown { |
| 24 |
|
| 25 |
public static function transform( $text ) { |
| 26 |
|
| 27 |
return Michelf\MarkdownExtra::defaultTransform( $text ); |
| 28 |
} |
| 29 |
} |
| 30 |
} |
| 31 |
|
| 32 |
/* |
| 33 |
* Provides the suext_markdown() function. |
| 34 |
*/ |
| 35 |
if ( ! function_exists( 'suext_markdown' ) ) { |
| 36 |
|
| 37 |
function suext_markdown( $text ) { |
| 38 |
|
| 39 |
return SuextMarkdown::transform( $text ); |
| 40 |
} |
| 41 |
} |
| 42 |
|