Я пытаюсь преобразовать HTML-текст в обычный текст, но URL-адрес, представленный в HTML, недоступен для простого текста
var htmlString = """
<p style=\"text-align: justify;\">The Ministry of Corporate Affairs (MCA) has informed vide Flash Alert that Form AGILE is likely to be revised on MCA21 Company Forms Download page with effect from May 31, 2019. </p>\n<p style=\"text-align: justify;\">Form AGILE is an application for Goods and services tax Identification number, employees state Insurance corporation registration plus Employees provident fund organisation registration. </p>\n<p style=\"text-align: justify;\">Stakeholders are advised to check the latest version before filing.</p>\n<p style=\"text-align: justify;\"><a href=\"http://www.mca.gov.in/ /
"""
let encodedData = htmlString.data(using: .unicode, allowLossyConversion: false)
var attributedString: NSAttributedString?
do {
attributedString = try NSAttributedString(data: encodedData!, options: [NSAttributedString.DocumentReadingOptionKey.documentType:NSAttributedString.DocumentType.html,NSAttributedString.DocumentReadingOptionKey.characterEncoding:NSNumber(value: String.Encoding.utf8.rawValue)], documentAttributes: nil)
} catch let error as NSError {
print(error.localizedDescription)
} catch {
print("error")
}
print(encodedData!)
print(attributedString)