Skip to content

flowbe/DecodeHTML

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DecodeHTML

Simply convert HTML to readable strings or attributed string in Swift!

Installation

Installation can be done via Swift Package Manager or by dragging Sources/DecodeHTML into your project.

dependencies: [
    .package(url: "https://github.com/flowbe/DecodeHTML.git", .upToNextMajor(from: "1.0.0"))
]

Usage

This package adds 2 properties to String.

  • htmlToString:
let myHtmlString = "C’est la France"
print("\(myHtmlString.htmlToString)") // prints "C'est la France"
  • htmlToAttributedString:
let myHtmlString = "C’est la France"
let label = UILabel()
label.attributedText = myHtmlString.htmlToAttributedString

About

A String extension to decode HTML entities to string

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages