tags:

views:

46

answers:

1

i have a velocity template...

It contains the following tag:

#field('itemname')

The "itemname" variable contains this:

<i>Some</i> <b>Example Title</b>

The source of the outputted page has this:

<i>Some</i> <b>Example Title</b>

So, the user sees the actual HTML tags:

<i>Some</i> <b>Example Title</b>

What I want them to see is:

Some Example Title

Where am I going wrong?

+1  A: 

If I see right from your snippets, the problem is not with the velocity template, but with the mime type encoding of the HTTP Response your user is receiving. It should be "text/html", but I suspect it's something else, and so, the browser is showing the tags instead of "rendering" them to what they represent.

Of course, I don't know what your

#field()
macro does, so the problem might be something else, e.g. that macro might generate a wrapping PRE tag or a Text Area, and this might be the cause you why the those B and I tags are displayed as they are instead of being rendered.

A. Ionescu