Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Add deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzalezreal committed Dec 5, 2021
1 parent e202584 commit ed252be
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions Sources/CommonMark/Internal/Deprecations.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import Foundation

extension Document {
@available(*, deprecated, message: "This property has been removed and returns an empty set")
public var imageURLs: Set<String> {
[]
}

@available(
*, deprecated, message: "Use init(markdown:options:) to create a document from a string"
)
public init(_ content: String) {
try! self.init(markdown: content)
}

@available(
*, deprecated,
message: "Use init(contentsOf:options:) to create a document from the contents of a URL"
)
public init(contentsOfFile path: String) throws {
try self.init(markdown: .init(contentsOfFile: path))
}

@available(
*, deprecated,
message: "Use init(contentsOf:options:) to create a document from the contents of a URL"
)
public init(contentsOfFile path: String, encoding: String.Encoding) throws {
try self.init(markdown: .init(contentsOfFile: path, encoding: encoding))
}
}

0 comments on commit ed252be

Please sign in to comment.