kbrsh / moon

🌙 The minimal & fast library for functional user interfaces
https://moonjs.org
MIT License
6k stars 200 forks source link

HTML parse from data object #242

Closed grimaldodev closed 5 years ago

grimaldodev commented 5 years ago

Hi Im getting the data prom an api but the content is html formatted, my question is how I parse to render correctly because I'm getting the string not the html inside my view:

{
content:" <p>Hi,</p>↵<p>DigitalOnUs Inc. top 20 fastest IT Services co. as per Inc.500 2018 ratings.</p>↵<p>As part of our ever growing requirements, "
}
kbrsh commented 5 years ago

In Moon v1, there is no current way of directly setting innerHTML. I am planning support for this with an innerHTML attribute.

<div innerHTML={content}></div>
dingjibang commented 5 years ago

@kbrsh excuse me, Is there a way to set innerHTML for a dom now?

kbrsh commented 5 years ago

This was implemented in c206837d6b3b1bf620b801e0c025e1171e5aafc1.