Skip to content

Commit 7c923fd

Browse files
authored
Merge pull request #424 from pennlabs/native-news-improvements
Native news improvements
2 parents e82feab + 3d27c22 commit 7c923fd

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

PennMobile/Home/Cells/News/NativeNewsViewController.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,14 @@ class NativeNewsViewController: UIViewController {
127127
paragraphTextView.isEditable = false
128128
paragraphTextView.attributedText = try? element.html().htmlToAttributedString
129129
paragraphTextView.textColor = .label
130-
paragraphTextView.font = UIFont.preferredFont(forTextStyle: .body, compatibleWith: .current)
130+
let subTag = element.children().first()?.tagName()
131+
if subTag == "em" && (try? element.children().first()?.html()) != "" {
132+
paragraphTextView.font = UIFont.preferredFont(forTextStyle: .headline, compatibleWith: .current)
133+
} else if subTag == "strong" && (try? element.children().first()?.html()) != "" {
134+
paragraphTextView.font = UIFont.preferredFont(forTextStyle: .title2, compatibleWith: .current)
135+
} else {
136+
paragraphTextView.font = UIFont.preferredFont(forTextStyle: .body, compatibleWith: .current)
137+
}
131138
bodyViews.append(paragraphTextView)
132139
case "figure":
133140
for subelement in element.children() {

0 commit comments

Comments
 (0)