Files
roundcubemail/tests/Framework/MarkdownTest.php
Pablo Zmdl 5cab1c5b1d Render text/markdown mimeparts as HTML (#9899)
This implements rendering mime-types with content-type 'text/markdown'
and 'text/x-markdown' into HTML in the preview and show views (if not
"dispositioned" as "attachment"), but not in the get view for attached
files (the one opening attachments in an external window.)
2025-06-19 17:01:09 +02:00

46 lines
870 B
PHP

<?php
namespace Roundcube\Tests\Framework;
use PHPUnit\Framework\TestCase;
/**
* Test class to test rcube_markdown class
*/
class MarkdownTest extends TestCase
{
public function test_to_html()
{
// A test string that includes syntax from GitHub Flavoured Markdown.
$source = <<<'END'
# A headline
Hello there!
---------
* one
* two
* three
~not~
END;
$expected = <<<'END'
<h1>A headline</h1>
<p>Hello there!</p>
<hr />
<ul>
<li>one</li>
<li>two</li>
<li>three</li>
</ul>
<p><del>not</del></p>
END;
$markdown = \rcube_markdown::to_html($source);
$this->assertSame($expected, $markdown);
}
}