Permalink
Browse files

Markdown image tags are now supported in comments

  • Loading branch information...
1 parent 26a4f78 commit 26aedac9f5d378c288372f86b249c4ef424b646e @KuiKui committed Jun 15, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/helper/MarkdownHelper.php
@@ -71,10 +71,6 @@ function Markdown($text) {
$parser = new $parser_class;
}
- # Generate Markdwon links from urls
- $pattern = "/(?i)\b((?:https?:\/\/|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'\".,<>?«»“”‘’]))/";
- $text = preg_replace($pattern, '[$1]($1)', $text);
-
# Generate line breaks (2 spaces are no more needed)
$text = preg_replace('/\r/', '', $text);
$text = preg_replace('/\n/', " \n", $text);
@@ -690,6 +686,10 @@ function doAnchors($text) {
if ($this->in_anchor) return $text;
$this->in_anchor = true;
+ # Generate Markdwon links from urls
+ $pattern = "/(?i)\b((?:https?:\/\/|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'\".,<>?«»“”‘’]))/";
+ $text = preg_replace($pattern, '[$1]($1)', $text);
+
#
# First, handle reference-style links: [link text] [id]
#

0 comments on commit 26aedac

Please sign in to comment.