Squashed commit of the following:
commit fea85fa8a47b4ccedb2b502b4537c6b261dc3eed Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Feb 3 16:41:57 2017 +0000 Make emoji more accessible commit 2bcb6e999b85aad361754f667ab8305db538176f Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Fri Jan 27 20:51:50 2017 +0000 Add an emoji into the seed file to test a11y techniques with.
This commit is contained in:
parent
13919c207e
commit
c0a4e220c4
4 changed files with 52 additions and 4 deletions
|
@ -6,6 +6,7 @@ use Normalizer;
|
|||
use Laravel\Scout\Searchable;
|
||||
use Jonnybarnes\IndieWeb\Numbers;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Jonnybarnes\EmojiA11y\EmojiModifier;
|
||||
use League\CommonMark\CommonMarkConverter;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Spatie\MediaLibrary\HasMedia\HasMediaTrait;
|
||||
|
@ -119,11 +120,13 @@ class Note extends Model implements HasMedia
|
|||
public function getNoteAttribute($value)
|
||||
{
|
||||
$markdown = new CommonMarkConverter();
|
||||
$emoji = new EmojiModifier();
|
||||
$html = $markdown->convertToHtml($value);
|
||||
$hcards = $this->makeHCards($html);
|
||||
$hashtags = $this->autoLinkHashtag($hcards);
|
||||
$modified = $emoji->makeEmojiAccessible($hashtags);
|
||||
|
||||
return $hashtags;
|
||||
return $modified;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue