Compare commits
2 Commits
fa358a3e97
...
38085eee37
Author | SHA1 | Date |
---|---|---|
Shadowfacts | 38085eee37 | |
Shadowfacts | e19364abdf |
|
@ -19,6 +19,7 @@ class ContentTextView: LinkTextView {
|
|||
var navigationDelegate: TuskerNavigationDelegate?
|
||||
|
||||
var defaultFont: UIFont = .systemFont(ofSize: 17)
|
||||
var defaultColor: UIColor = .label
|
||||
|
||||
override func awakeFromNib() {
|
||||
super.awakeFromNib()
|
||||
|
@ -117,9 +118,9 @@ class ContentTextView: LinkTextView {
|
|||
} else {
|
||||
text = node.text()
|
||||
}
|
||||
return NSAttributedString(string: text, attributes: [.font: defaultFont])
|
||||
return NSAttributedString(string: text, attributes: [.font: defaultFont, .foregroundColor: defaultColor])
|
||||
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() {
|
||||
attributed.append(attributedTextForHTMLNode(child, usePreformattedText: usePreformattedText || node.tagName() == "pre"))
|
||||
}
|
||||
|
@ -180,7 +181,7 @@ class ContentTextView: LinkTextView {
|
|||
// only accept touches that are over a link
|
||||
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
|
||||
if getLinkAtPoint(point) != nil || isSelectable {
|
||||
return self
|
||||
return super.hitTest(point, with: event)
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue