0

I am doing project to post a project idea(good analogy to the project is this stackoverflow post your quation form) to firebase realtime or firestore database which uses rich text editor in my case TinyMCE but I can't do so even if I search many websites.

I try to upload the whole html markup to Firebase(I have considered security issues) ,then to retrieve the markup(styles) in to my front end Angular app,but I can't.

is there anyone who help me ?

  • 1
    Rich Text cannot be stored in Firestore as Rich Text. Firestore is an ASCII (flat text) database (as most databases are). However, there are a number of options. Firebase supports Data fields - so if you can take your Rich Text document and encode it into a Data object, that can be saved. The downside is it will not be searchable. A second option is to store the Rich Text document in storage and keep a reference to that URL in Firestore - the user won't know the difference. The other option is to craft your own encoding, for example, storing the word BOLD could be BOLD – Jay Dec 14 '22 at 20:46
  • Thank you for all what you have said. can you send me a resource link to do so ? – Aderaw Molla Dec 15 '22 at 22:02
  • Sure! Here's a link to [Firebase Storage](https://firebase.google.com/docs/storage) if you want to store the file itself. If you want to encode it as a data object, that's a platform specific task; I posted a Swift answer to [this question](https://stackoverflow.com/questions/33644560/swift2-retrieving-images-from-firebase/34044446#34044446) which shows encoding and decoding in Swift. The answer [here](https://stackoverflow.com/questions/61981000/can-you-save-attributed-strings-to-cloud-firestore/62008574#62008574) is also Swift, converting an attributed string to Data. – Jay Dec 15 '22 at 23:33

0 Answers0