-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Link color does not work? #50
Comments
After some surfing I found a solution, though it's outside of MarkdownKit: var linkColor: UIColor = .darkGray
var underlineColor: UIColor = .lightGray
if #available(iOS 13.0, *) {
linkColor = .secondaryLabel
underlineColor = .quaternaryLabel
}
let linkAttributes: [NSAttributedString.Key: Any] = [
NSAttributedString.Key.foregroundColor: linkColor,
NSAttributedString.Key.underlineColor: underlineColor,
NSAttributedString.Key.underlineStyle: NSUnderlineStyle.single.rawValue
]
textView.linkTextAttributes = linkAttributes |
I think the cause is as follows. For links, the However, when text is actually formatted, those
So setting color has no effect. |
Sorry to prod but any working solution to this issue yet? @bmoliveira |
The link color attribute gets overriden by the textViews' |
Hi! I was glad to find this project, I was trying to use Down, but it's attributed string rendering leaves much to be desired. I thought this seemed like a great way to get a dark mode friendly Markdown parser into my project... and it is! So, thank you.
Unfortunately there appears to be a problem with link colors. Here's some example code...
While the main content of the string is colored properly no matter what, the link color appears to be stuck as a black color, even without the
link.color
call. I've triedlink.color = .red
as well, and no dice.The text was updated successfully, but these errors were encountered: