RejectedSoftware Forums

Sign up

Diet Template question

Hi everyone,

I think this might be unsupported syntax currently, and was wondering if anyone actually got it to work. Basically I'm trying to do this:

p Have some text #[a(href="/page") link text].

which should translate to:

<p>Have some text <a href="/page">link text</a>.</p>

The part that isn't working is the tag interpolation. Currently I can do:

p< Have some text 
  a(href="/page")> link text
  |.

which gets the desired result, but this is a little annoying since it requires a trailing space on the first line which can be easily missed when editing things, and some editor plugins will erroneously remove them.

Re: Diet Template question

Am 27.12.2015 um 21:13 schrieb Charles:

Hi everyone,

I think this might be unsupported syntax currently, and was wondering if anyone actually got it to work. Basically I'm trying to do this:

 p Have some text #[a(href="/page") link text].

which should translate to:

 <p>Have some text <a href="/page">link text</a>.</p>

The part that isn't working is the tag interpolation. Currently I can do:

 p< Have some text
   a(href="/page")> link text
   |.

which gets the desired result, but this is a little annoying since it requires a trailing space on the first line which can be easily missed when editing things, and some editor plugins will erroneously remove them.

This is indeed not yet supported. See
#964. Another
alternative is to use inline-HTML:

p Have some text <a href="/page">link text</a>.

...with the catch that #{string interpolations} inside HTML attributes
do not escape quotes (sounds like something that should really be fixed).