would someone have a suggestion about this? Thanks...
# prisma-whats-new
s
would someone have a suggestion about this? Thanks a lot https://graphcool.slack.com/archives/C0MQJ62NL/p1495897291703723
n
@sdubois It's not necessarily safer but storing the content as Markdown might be a whole lot easier and reduce the complexities you'll run into.
Plenty React markdown editors and viewers out there to get you going.
s
okay thanks. I'm not quite sure though if that would allow enough styling flexibility.
l
You should escape some html tags (for example <scripts>, or only allow some tags b, i, p, em etc ...)
This lib will help you to do that 🙂 https://github.com/punkave/sanitize-html
n
You can use html inside markdown for sure 😉
s
ah thanks @notrab @leopradel! Yes totally forgot html can go in markdown
j
@sdubois I'm working on a similar project using Draft.js as the editor. I store each node (Text, Image, Heading) as an entity within the graph itself as related items with a type and position. This allows me to safely pass the nodes back to the editor as props. But I can also parse and form the nodes into HTML through the render function too. Working with authors and editors I've found you can never trust what they are doing, so this provides the safest path.
s
@jjaybrown98 that sounds great! Is that proprietary or are you open-sourcing? I think a demo integrated with Graphcool would interest a lot of people, could even be featured in partnership with Graphcool maybe.
j
the draft.js integration can be open sourced. But the CMS itself is proprietary as it will be part of our publishing pipeline at LADbible
s
OK sounds good. Do you have a timeline and know where you intend to open-source?
j
prob not in the short term, we're still building it out
s
OK, I guess this is your github? https://github.com/TheLADbibleGroup
j
yeah that's it