Fix content text view text color in dark mode
This commit is contained in:
parent
fa358a3e97
commit
e19364abdf
|
@ -19,6 +19,7 @@ class ContentTextView: LinkTextView {
|
||||||
var navigationDelegate: TuskerNavigationDelegate?
|
var navigationDelegate: TuskerNavigationDelegate?
|
||||||
|
|
||||||
var defaultFont: UIFont = .systemFont(ofSize: 17)
|
var defaultFont: UIFont = .systemFont(ofSize: 17)
|
||||||
|
var defaultColor: UIColor = .label
|
||||||
|
|
||||||
override func awakeFromNib() {
|
override func awakeFromNib() {
|
||||||
super.awakeFromNib()
|
super.awakeFromNib()
|
||||||
|
@ -117,9 +118,9 @@ class ContentTextView: LinkTextView {
|
||||||
} else {
|
} else {
|
||||||
text = node.text()
|
text = node.text()
|
||||||
}
|
}
|
||||||
return NSAttributedString(string: text, attributes: [.font: defaultFont])
|
return NSAttributedString(string: text, attributes: [.font: defaultFont, .foregroundColor: defaultColor])
|
||||||
case let node as Element:
|
case let node as Element:
|
||||||
let attributed = NSMutableAttributedString(string: "", attributes: [.font: defaultFont])
|
let attributed = NSMutableAttributedString(string: "", attributes: [.font: defaultFont, .foregroundColor: defaultColor])
|
||||||
for child in node.getChildNodes() {
|
for child in node.getChildNodes() {
|
||||||
attributed.append(attributedTextForHTMLNode(child, usePreformattedText: usePreformattedText || node.tagName() == "pre"))
|
attributed.append(attributedTextForHTMLNode(child, usePreformattedText: usePreformattedText || node.tagName() == "pre"))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue