aboutsummaryrefslogtreecommitdiffhomepage
path: root/plugins/markdown/markdown.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/markdown/markdown.php')
-rw-r--r--plugins/markdown/markdown.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/markdown/markdown.php b/plugins/markdown/markdown.php
index 2f24e417..821bb125 100644
--- a/plugins/markdown/markdown.php
+++ b/plugins/markdown/markdown.php
@@ -6,6 +6,8 @@
6 * Shaare's descriptions are parsed with Markdown. 6 * Shaare's descriptions are parsed with Markdown.
7 */ 7 */
8 8
9use Shaarli\Config\ConfigManager;
10
9/* 11/*
10 * If this tag is used on a shaare, the description won't be processed by Parsedown. 12 * If this tag is used on a shaare, the description won't be processed by Parsedown.
11 */ 13 */
@@ -50,6 +52,7 @@ function hook_markdown_render_feed($data, $conf)
50 $value = stripNoMarkdownTag($value); 52 $value = stripNoMarkdownTag($value);
51 continue; 53 continue;
52 } 54 }
55 $value['description'] = reverse_feed_permalink($value['description']);
53 $value['description'] = process_markdown( 56 $value['description'] = process_markdown(
54 $value['description'], 57 $value['description'],
55 $conf->get('security.markdown_escape', true), 58 $conf->get('security.markdown_escape', true),
@@ -244,6 +247,11 @@ function reverse_space2nbsp($description)
244 return preg_replace('/(^| ) /m', '$1 ', $description); 247 return preg_replace('/(^| ) /m', '$1 ', $description);
245} 248}
246 249
250function reverse_feed_permalink($description)
251{
252 return preg_replace('@&#8212; <a href="([^"]+)" title="[^"]+">(\w+)</a>$@im', '&#8212; [$2]($1)', $description);
253}
254
247/** 255/**
248 * Replace not whitelisted protocols with http:// in given description. 256 * Replace not whitelisted protocols with http:// in given description.
249 * 257 *