-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example does not render as html? #141
Comments
By looking at the code it surely seems that it's intentional 😕. @pyykkis has it always been like that and is it intentional? Maybe it should be replaced with some other example either way |
The "Goodbye!" is also not rendered so I'm guessing thats not intentional.. |
if you add _class= "span"_ to the span _Goodbye!_ is rendered :) |
I love this project but I'm running into the same issue -- HTML is being rendered as plain text. +1 |
Maybe I didn't properly understand the question, but when I want to render a property as HTML, I use the relative directive: myobj = { description: "<i>banana</i>" }
mydirective = {description: {html: function (params) {return this.description}}}
$("<div class='mainbody'>\n\
<div class='description'></div>\n\
</div>").render(myobj, mydirective) Result: <div class='mainbody'>
<div class='description'><i>banana</i></div>
</div> |
@kristoff-it I wasn't aware of the relative directive, perhaps that would solve it. (Though it seems like a lot of overhead to include arbitrary HTML in a template). I was mainly confused as to why the demo itself doesn't seem to be rendering properly: http://leonidas.github.io/transparency/ In the |
Uhm yeah that's weird, I suppose it's something that has been left behind from the earlier days of this project. I've only used transparency for one project as of now, so I'm not a super expert, but:
If the HTML in question is generated by you in the browser, I suggest you try to change how your app is structured to make, for example, transparency handle also that rendering. If the HTML is recieved as-is, then you don't have much choice I guess, but it's not that bad, in my project I have to render some RSS feeds like this and, while the syntax is not the most concise, it still works flawlessly. I still prefere this over weird naming conventions a la Ruby. Alternatively you could |
Those seem like good workarounds, thanks @kristoff-it ! 👍 |
Is it normal that html tags are not rendered but output as string ?
http://leonidas.github.io/transparency/
?
The text was updated successfully, but these errors were encountered: