diff --git a/Package.swift b/Package.swift index f2a208b..d261095 100644 --- a/Package.swift +++ b/Package.swift @@ -5,6 +5,10 @@ import PackageDescription let package = Package( name: "HTMLStreamer", + platforms: [ + .iOS(.v13), + .macOS(.v10_15), + ], products: [ // Products define the executables and libraries a package produces, making them visible to other packages. .library( diff --git a/Sources/HTMLStreamer/AttributedStringConverter.swift b/Sources/HTMLStreamer/AttributedStringConverter.swift new file mode 100644 index 0000000..8459f3d --- /dev/null +++ b/Sources/HTMLStreamer/AttributedStringConverter.swift @@ -0,0 +1,320 @@ +// +// AttributedStringConverter.swift +// HTMLStreamer +// +// Created by Shadowfacts on 11/24/23. +// + +#if os(iOS) +import UIKit +#elseif os(macOS) +import AppKit +#endif + +struct AttributedStringConverter { + private let configuration: AttributedStringConverterConfiguration + private var tokenizer: Tokenizer + private let str = NSMutableAttributedString() + + private var actionStack: InlineArray3 = [] + private var styleStack: InlineArray3