mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-01-27 12:59:17 +01:00
Fix markdown rendering for statuses
This commit is contained in:
parent
03b304c58d
commit
2fdf5fe239
@ -46,10 +46,9 @@ extension HTMLString {
|
|||||||
|
|
||||||
public var asSafeAttributedString: AttributedString {
|
public var asSafeAttributedString: AttributedString {
|
||||||
do {
|
do {
|
||||||
let markdown = asMarkdown
|
|
||||||
let options = AttributedString.MarkdownParsingOptions(allowsExtendedAttributes: true,
|
let options = AttributedString.MarkdownParsingOptions(allowsExtendedAttributes: true,
|
||||||
interpretedSyntax: .inlineOnlyPreservingWhitespace)
|
interpretedSyntax: .inlineOnlyPreservingWhitespace)
|
||||||
return try AttributedString(markdown: markdown, options: options)
|
return try AttributedString(markdown: self, options: options)
|
||||||
} catch {
|
} catch {
|
||||||
return AttributedString(stringLiteral: self)
|
return AttributedString(stringLiteral: self)
|
||||||
}
|
}
|
||||||
|
@ -150,7 +150,7 @@ public class StatusEditorViewModel: ObservableObject {
|
|||||||
self.visibility = visibility
|
self.visibility = visibility
|
||||||
selectedRange = .init(location: statusText.string.utf16.count, length: 0)
|
selectedRange = .init(location: statusText.string.utf16.count, length: 0)
|
||||||
case let .edit(status):
|
case let .edit(status):
|
||||||
statusText = .init(status.content.asSafeAttributedString)
|
statusText = .init(status.content.asMarkdown.asSafeAttributedString)
|
||||||
selectedRange = .init(location: statusText.string.utf16.count, length: 0)
|
selectedRange = .init(location: statusText.string.utf16.count, length: 0)
|
||||||
spoilerOn = !status.spoilerText.isEmpty
|
spoilerOn = !status.spoilerText.isEmpty
|
||||||
spoilerText = status.spoilerText
|
spoilerText = status.spoilerText
|
||||||
|
Loading…
x
Reference in New Issue
Block a user