Skip to content

Commit

Permalink
Format politeia details description (#773)
Browse files Browse the repository at this point in the history
  • Loading branch information
dreacot committed May 30, 2021
1 parent fa1a925 commit 720ef31
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import Foundation
import UIKit
import Down

class PoliteiaDetailController: UIViewController {
@IBOutlet weak var titleLabel: UILabel!
Expand Down Expand Up @@ -140,7 +141,9 @@ class PoliteiaDetailController: UIViewController {
}

if politeia.indexfile != "" && politeia.fileversion == politeia.version {
self.contentTextView.text = politeia.indexfile
let down = Down(markdownString: politeia.indexfile)
let attributedString = try? down.toAttributedString()
self.contentTextView.attributedText = attributedString
} else {
self.contentLoadingIndicator.isHidden = false
DispatchQueue.global(qos: .userInitiated).async {
Expand All @@ -151,7 +154,9 @@ class PoliteiaDetailController: UIViewController {
if error != nil {
self.contentTextView.text = error?.localizedDescription
} else {
self.contentTextView.text = description
let down = Down(markdownString: description!)
let attributedString = try? down.toAttributedString()
self.contentTextView.attributedText = attributedString
}
}
}
Expand Down
1 change: 1 addition & 0 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ target 'Decred Wallet' do

pod 'JGProgressHUD'
pod 'QRCodeReader.swift'
pod 'Down'

end
6 changes: 5 additions & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
PODS:
- Down (0.11.0)
- JGProgressHUD (2.2)
- QRCodeReader.swift (10.1.0)

DEPENDENCIES:
- Down
- JGProgressHUD
- QRCodeReader.swift

SPEC REPOS:
trunk:
- Down
- JGProgressHUD
- QRCodeReader.swift

SPEC CHECKSUMS:
Down: b6ba1bc985c9d2f4e15e3b293d2207766fa12612
JGProgressHUD: d83d7a981b85d11205e19ff8ad5bb9c40571c847
QRCodeReader.swift: 373a389fe9a22d513c879a32a6f647c58f4ef572

PODFILE CHECKSUM: 64169a56707a1ecbb7c4d47f0d73f353f9e24ba6
PODFILE CHECKSUM: 9b9ccdaabb19ede54b35393bb86595cf157fece5

COCOAPODS: 1.10.1

0 comments on commit 720ef31

Please sign in to comment.