feat: Refactor mention rendering and generator classes
- Add support for Mastodon username mentions - Add test for parsing Mastodon usernames in notes - Modify namespace and class imports for `MentionGenerator` and `MentionRenderer` in `Note.php` - Rename `ContactMentionGenerator.php` to `MentionGenerator.php`
This commit is contained in:
parent
3817545cf3
commit
05c63b241d
5 changed files with 55 additions and 31 deletions
17
app/CommonMark/Generators/MentionGenerator.php
Normal file
17
app/CommonMark/Generators/MentionGenerator.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\CommonMark\Generators;
|
||||
|
||||
use League\CommonMark\Extension\Mention\Generator\MentionGeneratorInterface;
|
||||
use League\CommonMark\Extension\Mention\Mention;
|
||||
use League\CommonMark\Node\Inline\AbstractInline;
|
||||
|
||||
class MentionGenerator implements MentionGeneratorInterface
|
||||
{
|
||||
public function generateMention(Mention $mention): ?AbstractInline
|
||||
{
|
||||
return $mention;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue