I have a web app that saves formatted text content into DB. At first this was just a web app so HTML format seemed the most appropriate and gave immediate results. But in time this same content will be displayed on other clients and platforms (native iOS and native Android apps) use other means of displaying formatted text natively than HTML.
Note: I'm not an iOS/Android developer so mind that I don't know at all how to display richly formatted content (text/images/links?) on these other platforms.
Beside this content portability I'm also manipulating it like trimming it at content blocks closest to some index (i.e. trim at paragraph end that is closest to index N). This is not a simple task to do in pure HTML as block content can be anything really and simply trimming doesn't work as tags have to be correctly closed afterwards etc... I know HTMLAgilityPack helps in this regard, but other formats may be much easier to process.
Requirements
- Simple transformation from HTML (created on web) => portable (goes into DB) > back to native (of the respected client)
- Simple parsing and manipulation - trimming at specific block indices, searching for specific content types (i.e. images or links)
- Quick parsing and manipulation - must be very quick so it scales
The idea is that I would like to save my content in the most platform-portable format that also allows simple and quick content manipulation. At least simple in comparison to working with HTML.
I know this may look like a question that sparks opinion that's why I would like you to not just provide your suggestion but also back it up (possibly with proof) so I may choose the best suitable format to use in my scenario. Hopefully you have experience in native mobile platforms so you should know what kind of format would be best suitable for these platforms and we can then combine this with web technologies.
I suppose this is nowadays a common problem that many have already solved hence I don't want to invent water where others have already invented wine...
Aucun commentaire:
Enregistrer un commentaire