]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Merge pull request #525 from ArthurHoaro/plugins/feeds-markdown2
authorArthur <arthur@hoa.ro>
Sat, 9 Apr 2016 14:35:41 +0000 (16:35 +0200)
committerArthur <arthur@hoa.ro>
Sat, 9 Apr 2016 14:35:41 +0000 (16:35 +0200)
Process feeds content with Markdown

plugins/markdown/markdown.php

index 544ed22ecb6c71f0b8b769df580b661d5e3aa5be..57fcce3268a6aa5c0454e97cab9a395959635e46 100644 (file)
@@ -33,6 +33,25 @@ function hook_markdown_render_linklist($data)
     return $data;
 }
 
+/**
+ * Parse feed linklist descriptions.
+ *
+ * @param array $data linklist data.
+ *
+ * @return mixed linklist data parsed in markdown (and converted to HTML).
+ */
+function hook_markdown_render_feed($data)
+{
+    foreach ($data['links'] as &$value) {
+        if (!empty($value['tags']) && noMarkdownTag($value['tags'])) {
+            continue;
+        }
+        $value['description'] = process_markdown($value['description']);
+    }
+
+    return $data;
+}
+
 /**
  * Parse daily descriptions.
  *