How about
MARKMIN(text, extra={pre_with_code: lambda text:
precode{0}/code/pre.
format(XML(text, sanitize=True))})
--
This would be safe but t may mess up the output. In principe the text
inside code/ should be allowed to contain any html including script but
it should not be able to close the code tag. I think the right solution
is:
MARKMIN(text, extra={pre_with_code: lambda text:
How I can use code tag with Markmin? Thank you.
--
``
htmlbodyHello World/body/html
``:code_html
``
print hello world
``:code_python
On Tue, Jan 22, 2013 at 1:50 AM, Ignacio Ocampo naf...@gmail.com wrote:
How I can use code tag with Markmin? Thank you.
--
--
Bruno, thank you.
But if I only need the simple code?
code
anything
/code
How I can do it?
On Monday, January 21, 2013 9:56:35 PM UTC-6, rochacbruno wrote:
``
htmlbodyHello World/body/html
``:code_html
``
print hello world
``:code_python
On Tue, Jan 22, 2013 at 1:50 AM, Ignacio
``
Your code here
``
for testing: http://web2py.com/markmin
--
Thank you Bruno,
and precodeanything/code/pre :) ?
On Mon, Jan 21, 2013 at 10:09 PM, Bruno Rocha rochacbr...@gmail.com wrote:
``
Your code here
``
for testing: http://web2py.com/markmin
--
--
Ignacio Ocampo Millán
--
for this I thinnk you sould use extra render.
{{text = `` here is my code ``:pre_with_code}}
{{=MARKMIN(text, extra={pre_with_code: lambda text:
precode{0}/code/pre.format(text)})}}
Tested on shell
In [4]: text = `` here is my code ``:pre_with_code
In [5]: print MARKMIN(text,
This works
MARKMIN(text, extra={pre_with_code: lambda text:
precode{0}/code/pre.format(text)})
but is is a little dangerous since the user can do
``
/code/pre
scriptalert('oops!');/script
precode
``
The argument of text should be escaped somehow. Not sure how since you want
to allow verbatim
Very fun! :)
On Mon, Jan 21, 2013 at 11:22 PM, Massimo Di Pierro
massimo.dipie...@gmail.com wrote:
This works
MARKMIN(text, extra={pre_with_code: lambda text:
precode{0}/code/pre.**format(text)})
but is is a little dangerous since the user can do
``
/code/pre
10 matches
Mail list logo