Markdown
This commit is contained in:
parent
7740802940
commit
33539aa006
15
app/Http/Middleware/Michelf/Markdown.inc.php
Normal file
15
app/Http/Middleware/Michelf/Markdown.inc.php
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* Copyright © 2016 - 2023 筱锋xiao_lfeng. All Rights Reserved.
|
||||||
|
* 开发开源遵循 MIT 许可,若需商用请联系开发者
|
||||||
|
* https://www.x-lf.com/
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Use this file if you cannot use class autoloading. It will include all the
|
||||||
|
// files needed for the Markdown parser.
|
||||||
|
//
|
||||||
|
// Take a look at the PSR-0-compatible class autoloading implementation
|
||||||
|
// in the Readme.php file if you want a simple autoloader setup.
|
||||||
|
|
||||||
|
require_once dirname(__FILE__) . '/MarkdownInterface.php';
|
||||||
|
require_once dirname(__FILE__) . '/Markdown.php';
|
1886
app/Http/Middleware/Michelf/Markdown.php
Normal file
1886
app/Http/Middleware/Michelf/Markdown.php
Normal file
File diff suppressed because it is too large
Load Diff
16
app/Http/Middleware/Michelf/MarkdownExtra.inc.php
Normal file
16
app/Http/Middleware/Michelf/MarkdownExtra.inc.php
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* Copyright © 2016 - 2023 筱锋xiao_lfeng. All Rights Reserved.
|
||||||
|
* 开发开源遵循 MIT 许可,若需商用请联系开发者
|
||||||
|
* https://www.x-lf.com/
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Use this file if you cannot use class autoloading. It will include all the
|
||||||
|
// files needed for the MarkdownExtra parser.
|
||||||
|
//
|
||||||
|
// Take a look at the PSR-0-compatible class autoloading implementation
|
||||||
|
// in the Readme.php file if you want a simple autoloader setup.
|
||||||
|
|
||||||
|
require_once dirname(__FILE__) . '/MarkdownInterface.php';
|
||||||
|
require_once dirname(__FILE__) . '/Markdown.php';
|
||||||
|
require_once dirname(__FILE__) . '/MarkdownExtra.php';
|
1869
app/Http/Middleware/Michelf/MarkdownExtra.php
Normal file
1869
app/Http/Middleware/Michelf/MarkdownExtra.php
Normal file
File diff suppressed because it is too large
Load Diff
14
app/Http/Middleware/Michelf/MarkdownInterface.inc.php
Normal file
14
app/Http/Middleware/Michelf/MarkdownInterface.inc.php
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* Copyright © 2016 - 2023 筱锋xiao_lfeng. All Rights Reserved.
|
||||||
|
* 开发开源遵循 MIT 许可,若需商用请联系开发者
|
||||||
|
* https://www.x-lf.com/
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Use this file if you cannot use class autoloading. It will include all the
|
||||||
|
// files needed for the MarkdownInterface interface.
|
||||||
|
//
|
||||||
|
// Take a look at the PSR-0-compatible class autoloading implementation
|
||||||
|
// in the Readme.php file if you want a simple autoloader setup.
|
||||||
|
|
||||||
|
require_once dirname(__FILE__) . '/MarkdownInterface.php';
|
35
app/Http/Middleware/Michelf/MarkdownInterface.php
Normal file
35
app/Http/Middleware/Michelf/MarkdownInterface.php
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* Copyright © 2016 - 2023 筱锋xiao_lfeng. All Rights Reserved.
|
||||||
|
* 开发开源遵循 MIT 许可,若需商用请联系开发者
|
||||||
|
* https://www.x-lf.com/
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace App\Http\Middleware\Michelf;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Markdown Parser Interface
|
||||||
|
*/
|
||||||
|
interface MarkdownInterface {
|
||||||
|
/**
|
||||||
|
* Initialize the parser and return the result of its transform method.
|
||||||
|
* This will work fine for derived classes too.
|
||||||
|
*
|
||||||
|
* @api
|
||||||
|
*
|
||||||
|
* @param string $text
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function defaultTransform(string $text): string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Main function. Performs some preprocessing on the input text
|
||||||
|
* and pass it through the document gamut.
|
||||||
|
*
|
||||||
|
* @api
|
||||||
|
*
|
||||||
|
* @param string $text
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function transform(string $text): string;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user