X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/2f6ff0734773c4ac009de699a2661971fd585b22..refs/pull/2515/head:/app/Uploads/Attachment.php diff --git a/app/Uploads/Attachment.php b/app/Uploads/Attachment.php index 6e55003a9..d1060477d 100644 --- a/app/Uploads/Attachment.php +++ b/app/Uploads/Attachment.php @@ -1,10 +1,20 @@ id); } + + /** + * Generate a HTML link to this attachment. + */ + public function htmlLink(): string + { + return ''.e($this->name).''; + } + + /** + * Generate a markdown link to this attachment. + */ + public function markdownLink(): string + { + return '['. $this->name .']('. $this->getUrl() .')'; + } }