diff options
-rw-r--r-- | plugins/markdown/markdown.php | 2 | ||||
-rw-r--r-- | tests/plugins/PluginMarkdownTest.php | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/plugins/markdown/markdown.php b/plugins/markdown/markdown.php index 628970d6..f6f66cc5 100644 --- a/plugins/markdown/markdown.php +++ b/plugins/markdown/markdown.php | |||
@@ -259,7 +259,7 @@ function reverse_space2nbsp($description) | |||
259 | 259 | ||
260 | function reverse_feed_permalink($description) | 260 | function reverse_feed_permalink($description) |
261 | { | 261 | { |
262 | return preg_replace('@— <a href="([^"]+)" title="[^"]+">(\w+)</a>$@im', '— [$2]($1)', $description); | 262 | return preg_replace('@— <a href="([^"]+)" title="[^"]+">([^<]+)</a>$@im', '— [$2]($1)', $description); |
263 | } | 263 | } |
264 | 264 | ||
265 | /** | 265 | /** |
diff --git a/tests/plugins/PluginMarkdownTest.php b/tests/plugins/PluginMarkdownTest.php index 9ddbc558..15fa9ba5 100644 --- a/tests/plugins/PluginMarkdownTest.php +++ b/tests/plugins/PluginMarkdownTest.php | |||
@@ -156,6 +156,16 @@ class PluginMarkdownTest extends \PHPUnit\Framework\TestCase | |||
156 | $this->assertEquals($expected, $processedText); | 156 | $this->assertEquals($expected, $processedText); |
157 | } | 157 | } |
158 | 158 | ||
159 | public function testReverseFeedDirectLink() | ||
160 | { | ||
161 | $text = 'Description... '; | ||
162 | $text .= '— <a href="http://domain.tld/?0oc_VQ" title="Direct link">Direct link</a>'; | ||
163 | $expected = 'Description... — [Direct link](http://domain.tld/?0oc_VQ)'; | ||
164 | $processedText = reverse_feed_permalink($text); | ||
165 | |||
166 | $this->assertEquals($expected, $processedText); | ||
167 | } | ||
168 | |||
159 | public function testReverseLastFeedPermalink() | 169 | public function testReverseLastFeedPermalink() |
160 | { | 170 | { |
161 | $text = 'Description... '; | 171 | $text = 'Description... '; |