Skip to content

Commit 6518726

Browse files
Merge pull request #1199 from wordpress-mobile/issue/implement_method_to_get_html_from_string
Make available method to extract HTML from a string.
2 parents 6c4e208 + d1146bb commit 6518726

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Aztec/Classes/TextKit/TextStorage.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,10 @@ open class TextStorage: NSTextStorage {
369369
open func getHTML(prettify: Bool = false, range: NSRange) -> String {
370370
return htmlConverter.html(from: self.attributedSubstring(from: range), prettify: prettify)
371371
}
372+
373+
open func getHTML(prettify: Bool = false, from attributedString: NSAttributedString) -> String {
374+
return htmlConverter.html(from: attributedString, prettify: prettify)
375+
}
372376

373377
func setHTML(_ html: String, defaultAttributes: [NSAttributedString.Key: Any]) {
374378
let originalLength = length

0 commit comments

Comments
 (0)