aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/plugins/PluginMarkdownTest.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2018-10-06 13:28:51 +0200
committerGitHub <noreply@github.com>2018-10-06 13:28:51 +0200
commitfa8100c088ac990fde08a872816ea7dcfbf54202 (patch)
treee905192000d9f2d840a3151d6cb8331148f55506 /tests/plugins/PluginMarkdownTest.php
parent86e1bc713fd7fa74d6a17a7687428fa1c6d3c5f2 (diff)
parentcb7940e2deacba66f2510816732be654b255cc70 (diff)
downloadShaarli-fa8100c088ac990fde08a872816ea7dcfbf54202.tar.gz
Shaarli-fa8100c088ac990fde08a872816ea7dcfbf54202.tar.zst
Shaarli-fa8100c088ac990fde08a872816ea7dcfbf54202.zip
Merge pull request #1212 from ArthurHoaro/hotfix/hashtag-md-escape
Fix hashtags with markdown escape enabled
Diffstat (limited to 'tests/plugins/PluginMarkdownTest.php')
-rw-r--r--tests/plugins/PluginMarkdownTest.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/plugins/PluginMarkdownTest.php b/tests/plugins/PluginMarkdownTest.php
index b31e817f..319a94ba 100644
--- a/tests/plugins/PluginMarkdownTest.php
+++ b/tests/plugins/PluginMarkdownTest.php
@@ -107,6 +107,18 @@ class PluginMarkdownTest extends PHPUnit_Framework_TestCase
107 } 107 }
108 108
109 /** 109 /**
110 * Test reverse_text2clickable().
111 */
112 public function testReverseText2clickableHashtags()
113 {
114 $text = file_get_contents('tests/plugins/resources/hashtags.raw');
115 $md = file_get_contents('tests/plugins/resources/hashtags.md');
116 $clickableText = hashtag_autolink($text);
117 $reversedText = reverse_text2clickable($clickableText);
118 $this->assertEquals($md, $reversedText);
119 }
120
121 /**
110 * Test reverse_nl2br(). 122 * Test reverse_nl2br().
111 */ 123 */
112 public function testReverseNl2br() 124 public function testReverseNl2br()
@@ -246,7 +258,7 @@ class PluginMarkdownTest extends PHPUnit_Framework_TestCase
246 $this->conf->get('security.markdown_escape', true), 258 $this->conf->get('security.markdown_escape', true),
247 $this->conf->get('security.allowed_protocols') 259 $this->conf->get('security.allowed_protocols')
248 ); 260 );
249 $this->assertEquals($html, $data); 261 $this->assertEquals($html, $data . PHP_EOL);
250 } 262 }
251 263
252 /** 264 /**