Skip to content
Snippets Groups Projects
Verified Commit 01bb2ee0 authored by Andrej Ramašeuski's avatar Andrej Ramašeuski
Browse files

Cistka postu

parent 68f6aeb2
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,8 @@ package CF::Schema::Result::Post;
use strict;
use warnings;
use feature 'signatures';
no warnings qw{ experimental::signatures };
use base 'DBIx::Class::Core';
......@@ -52,4 +54,14 @@ __PACKAGE__->has_many(
{ 'foreign.post_id' => 'self.id', },
);
__PACKAGE__->inflate_column('content', {
deflate => sub ($content) {
# inline image
$content = s/!\[.*?\]\(.+?\)//gs;
# reference image
$content = s/!\[.*?\]\[.+?\]//gs;
return $content;
},
});
1;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment