facebook / lexical-ios

Lexical iOS is an extensible text editor framework that integrates the APIs and philosophies from Lexical Web with a Swift API built on top of TextKit.
MIT License
549 stars 41 forks source link

Import HTML into LexicalView/Editor #60

Open khurram18 opened 7 months ago

khurram18 commented 7 months ago

Currently there is no way to import simple HTML content into LexicalView/Editor. I am using the below code to export the HTML from editor using the sample code from LexicalPlayground app

try? editor.read {
      do {
        self.output = try generateHTMLFromNodes(editor: editor, selection: nil)
      } catch let error {
        self.output = error.localizedDescription
      }
    }

Can anyone please suggest the best way to import this generated output back into LexicalView/Editor?