Em 22/5/2010 13:07, steve donovan escreveu:
On Sat, May 22, 2010 at 4:42 PM, Itamar Eduardo
<[email protected]> wrote:
If a declare that my_body = h2"Hello World!" it will output correctly Hello
World!,
but if the value comes from a string of database, like my_body =
params.section.body, where params.section.body value is h2"Hello World!" it
prints h2"Hello World!".
Those little functions h1, h2 etc don't initially exist, but are
created when on request. And this only happens in functions which
have been passed to htmlify(). These functions have a special
environment which converts a 'function not found' into a custom
function which creates some HTML.
loadstring() compiles some text into a function, and so you must pass
that function to htmlify first before calling it, so that it will do
the correct magic!
Thanks man, I did like this:
local my_body = [[function
dobody() return ]]..params.section.body..[[ end orbit.htmlify(dobody)]]
loadstring(my_body)()
my_body = dobody()
is this the best way to do it?
--
teste
Itamar Eduardo Gonçalves de Oliveira
Informática
+55 (66) 2101 0614
|
_______________________________________________
Kepler-Project mailing list
[email protected]
http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project
http://www.keplerproject.org/