User About Markdown Formatting

This commit is contained in:
Refringe 2024-10-12 13:09:42 -06:00
parent 7eed2e6a07
commit d4d0a1495a
Signed by: Refringe
SSH Key Fingerprint: SHA256:t865XsQpfTeqPRBMN2G6+N8wlDjkgUCZF3WGW6O9N/k
3 changed files with 6 additions and 3 deletions

View File

@ -388,7 +388,7 @@ class ImportHubDataJob implements ShouldBeUnique, ShouldQueue
'name' => $hubUser->username,
'email' => Str::lower($hubUser->email),
'password' => $this->cleanPasswordHash($hubUser->password),
'about' => $this->fetchUserAbout($hubUser->userID) ?? '',
'about' => $this->fetchUserAbout($hubUser->userID),
'profile_photo_path' => $this->fetchUserAvatar($curl, $hubUser),
'cover_photo_path' => $this->fetchUserCoverPhoto($curl, $hubUser),
'created_at' => $this->cleanRegistrationDate($hubUser->registrationDate),
@ -432,7 +432,7 @@ class ImportHubDataJob implements ShouldBeUnique, ShouldQueue
$converter = new HtmlConverter;
$clean = Purify::clean($dirty);
return $converter->convert($clean) ?? '';
return $converter->convert($clean);
}
/**

View File

@ -32,7 +32,10 @@ class UserFactory extends Factory
'email' => fake()->unique()->safeEmail(),
'email_verified_at' => now(),
'password' => static::$password ??= Hash::make('password'),
// TODO: Does Faker have a markdown plugin?
'about' => fake()->paragraphs(random_int(1, 10), true),
'two_factor_secret' => null,
'two_factor_recovery_codes' => null,
'remember_token' => Str::random(10),

View File

@ -43,7 +43,7 @@
{{-- About --}}
@if ($user->about)
<div class="p-4 sm:p-6 bg-white dark:bg-gray-950 rounded-xl shadow-md dark:shadow-gray-950 text-gray-800 dark:text-gray-200 drop-shadow-2xl">
{{ $user->about }}
{!! Str::markdown($user->about) !!}
</div>
@endif