forked from zelo72/mastodon-ios
fix: profile bio line break get trimmed issue. resolve #311
This commit is contained in:
parent
b3c591dc33
commit
7380d28d74
|
@ -90,7 +90,10 @@ extension ProfileHeaderViewModel {
|
|||
extension ProfileHeaderViewModel {
|
||||
|
||||
static func normalize(note: String?) -> String? {
|
||||
guard let note = note?.trimmingCharacters(in: .whitespacesAndNewlines),!note.isEmpty else {
|
||||
let _note = note?.replacingOccurrences(of: "<br>|<br />", with: "\u{2028}", options: .regularExpression, range: nil)
|
||||
.replacingOccurrences(of: "</p>", with: "</p>\u{2029}", range: nil)
|
||||
.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
guard let note = _note, !note.isEmpty else {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -953,6 +953,7 @@ extension ProfileViewController: ProfileHeaderViewDelegate {
|
|||
viewModel.isUpdating.value = true
|
||||
Task {
|
||||
do {
|
||||
// TODO: handle error
|
||||
_ = try await viewModel.updateProfileInfo(
|
||||
headerProfileInfo: profileHeaderViewModel.editProfileInfo,
|
||||
aboutProfileInfo: profileAboutViewModel.editProfileInfo
|
||||
|
|
Loading…
Reference in New Issue