Skip to content

Commit

Permalink
fix: consider embedded images in markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
ScuffedNewt authored Aug 12, 2024
1 parent dc7d2ac commit b3bd40c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/Models/Comment/Comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ public function getTopCommentAttribute() {
*/
public function getCommentAttribute() {
if (config('lorekeeper.settings.wysiwyg_comments')) {
return preg_replace('/(https?:\/\/[^\s]+)/', '<a href="$1" target="_blank">link</a>', $this->attributes['comment']);
return preg_replace('/(?<!\()(https?:\/\/[^\s]+)/', '<a href="$1" target="_blank">link</a>', $this->attributes['comment']);
}

return preg_replace('/(https?:\/\/[^\s]+)/', '[link]($1)', $this->attributes['comment']);
return preg_replace('/(?<!\()(https?:\/\/[^\s]+)/', '<a href="$1" target="_blank">link</a>', $this->attributes['comment']);
}
}

0 comments on commit b3bd40c

Please sign in to comment.