diff --git a/Proton/Sources/Swift/Core/ListParser.swift b/Proton/Sources/Swift/Core/ListParser.swift index 88995cbf..3d650ed2 100644 --- a/Proton/Sources/Swift/Core/ListParser.swift +++ b/Proton/Sources/Swift/Core/ListParser.swift @@ -33,6 +33,17 @@ public struct ListItem { /// Attribute value of the list item. public let attributeValue: Any + + /// Creates a `ListItem` + /// - Parameters: + /// - text: Attributed value for text in `ListItem` + /// - level: Indentation level of `ListItem`. + /// - attributeValue: Attribute value to be applied to entire text range of `ListItem` + public init(text: NSAttributedString, level: Int, attributeValue: Any) { + self.text = text + self.level = level + self.attributeValue = attributeValue + } } /// Provides helper function to convert between `NSAttributedString` and `[ListItem]` diff --git a/Proton/Tests/Core/ListParserTests.swift b/Proton/Tests/Core/ListParserTests.swift index a81cd265..99311cc2 100644 --- a/Proton/Tests/Core/ListParserTests.swift +++ b/Proton/Tests/Core/ListParserTests.swift @@ -21,7 +21,7 @@ import Foundation import XCTest -@testable import Proton +import Proton class ListParserTests: XCTestCase {