[Bese-devel] Re: strings as parameters in TAL templates

Jan Rychter jan at rychter.com
Fri Feb 3 15:36:59 UTC 2006


>>>>> "Marco" == Marco Baringer <mb at bese.it> writes:
 Marco> Jan Rychter wrote:
 >> How do you handle string parameters in TAL tags? Specifically,
 >> quoting?
 >>
 >> I've tried this:
 >>
 >> <tal:tal tal:content='(inline-image "dir1/crw_1122.jpg")' />
 >>
 >> but it results in garbage generated after the tag is replaced, I get
 >> extra: /></a >
 >>
 >> I need to pass a lisp string to the inline-image function.

 Marco> if inline-image is a string containing #\< or #\> yaclml will
 Marco> escape those and generate > and <, this may be your
 Marco> problem. try adding tal:escape-html='nil' to the tal:tal tag and
 Marco> see if that helps. if it doesn't i'll need enough code to
 Marco> reproduce the bug.

It doesn't, but there is clearly something I don't
understand. inline-image generates HTML using yaclml, here is a
narrowed-down case:

(defun inline-image (filename)
  (<:div :class "inline-image"
	 (<:a :class "inline-image"
	      :href "sample/image.jpg"
	      filename)))

This results in:

<div class="inline-image"
  ><a class="inline-image" href="sample/image.jpg"
    ></a
  ></div
></a
  ></div
>

--J.



More information about the bese-devel mailing list