@@ -53,13 +53,8 @@ class PostViewCell: UITableViewCell
53 fatalError("init(coder:) has not been implemented")
53 fatalError("init(coder:) has not been implemented")
56− func createTextView(with text: String, _ isSelectable: Bool) -> UITextView
56+ func createTextView(with text: NSAttributedString, _ isSelectable: Bool) -> UITextView
58− let markdownParser = MarkdownParser(font: UIFont.systemFont(ofSize: 16))
60− markdownParser.enabledElements = .disabledAutomaticLink
61− markdownParser.code.textBackgroundColor = #colorLiteral(red: 0.8039215803, green: 0.8039215803, blue: 0.8039215803, alpha: 1)
63 let textView = UITextView()
58 let textView = UITextView()
64 textView.isScrollEnabled = false
59 textView.isScrollEnabled = false
65 textView.isEditable = false
60 textView.isEditable = false
@@ -69,24 +64,22 @@ class PostViewCell: UITableViewCell
70 textView.isUserInteractionEnabled = false
65 textView.isUserInteractionEnabled = false
72− textView.attributedText = markdownParser.parse(markdown)
68+ textView.attributedText = text
73 return textView
69 return textView
76 var views: [UIView] = []
72 var views: [UIView] = []
77 var post: Model.Posts?
73 var post: Model.Posts?
79− func fill(with info: [Model.Attachments], _ isFullVersoin: Bool, post: Model.Posts)
75+ func fill(with info: NSAttributedString, _ isFullVersoin: Bool, post: Model.Posts)
81 self.post = post
77 self.post = post
82 // important
78 // important
83 contentView.subviews.forEach({ $0.removeFromSuperview() })
79 contentView.subviews.forEach({ $0.removeFromSuperview() })
85 views = []
81 views = []
86− for attachment in info
88− views.append(createTextView(with: attachment.markdown, isFullVersoin))
82+ views.append(createTextView(with: info, isFullVersoin))
91 nameLabel.setTitle("\(post.user?.firstName ?? "") \(post.user?.lastName ?? "")", for: .normal)
84 nameLabel.setTitle("\(post.user?.firstName ?? "") \(post.user?.lastName ?? "")", for: .normal)
92 nameLabel.addTarget(self, action: #selector(displayProfile), for: .touchUpInside)
85 nameLabel.addTarget(self, action: #selector(displayProfile), for: .touchUpInside)