html escape

sourceuno
Posts: 225
Joined: Mon Apr 09, 2001 3:58 pm

html escape

Post by sourceuno »

I want the following string to be output in html with the proper tags, but the output of the page shows <b>topicname</b><br>. How do I do this correctly?

<sum "%s" $catstr "<b>" $topicname "</b><br>">
$ret
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

html escape

Post by mark »

no need for sum. just use

$catstr<b>$topicname</b><br>
sourceuno
Posts: 225
Joined: Mon Apr 09, 2001 3:58 pm

html escape

Post by sourceuno »

I actually do need the sum since I will be adding strings to this string after the sum statement, so I need to store it in a variable.
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

html escape

Post by mark »

If you're sure $catstr and $topicname are properly encoded for HTML you can use <send $ret>. Otherwise use strfmt with %H to make sure they are encoded.
<strfmt "%H<b>%H</b><br>" $catstr $topicname>

Or you could <capture> my previous suggestion.