File tree Expand file tree Collapse file tree
PennMobile/Home/Cells/News Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ( ) {
You can’t perform that action at this time.
0 commit comments