CommonMarkAttributedString
CommonMarkAttributedString copied to clipboard
Customise each markdown element
Hello,
It's important to be able to customise markdown elements with needed attributes. So I would like to suggest breaking API change. See the code sample below.
Does it fit with the idea of the current framework?
public struct Attributes {
public var blockQuote: [NSAttributedString.Key : Any]?
public var codeBlock: [NSAttributedString.Key : Any]?
public var emphasis: [NSAttributedString.Key : Any]?
public var heading1: [NSAttributedString.Key : Any]?
public var heading2: [NSAttributedString.Key : Any]?
public var heading3: [NSAttributedString.Key : Any]?
public var heading4: [NSAttributedString.Key : Any]?
public var heading5: [NSAttributedString.Key : Any]?
public var heading6: [NSAttributedString.Key : Any]?
public var list: [NSAttributedString.Key : Any]?
public var listItem: [NSAttributedString.Key : Any]?
public var link: [NSAttributedString.Key : Any]?
public var strong: [NSAttributedString.Key : Any]?
public var text: [NSAttributedString.Key : Any]?
}
public convenience init(
commonmark: String,
attributes: Attributes? = nil,
attachments: [String: NSTextAttachment]? = nil
) throws {
...
}