Un Verb

Post Reply
gaurav.shetti
Posts: 119
Joined: Fri Feb 27, 2009 9:09 am

Un Verb

Post by gaurav.shetti »

I know that the function <verb> works as follows

<verb>
<HTML>
$x
</verb>

will give the o/p as
<HTML>
$x

Now how do we convert them back to html tags .. like retrieve the former form.. Any function ?
User avatar
jason112
Site Admin
Posts: 347
Joined: Tue Oct 26, 2004 5:35 pm

Un Verb

Post by jason112 »

The act of converting < and > to < and > is referred to as "html escaping". There are fmt flags for escaping and unescaping (%H and %!H, respectively).

This code
<$data="<html>">
<fmt "before: %s" $data>

<strfmt "%H" $data><$data=$ret>
<fmt "escaped: %s" $data>

<strfmt "%!H" $data><$data=$ret>
<fmt "unescaped: %s" $data>

produces:
before: <html>
escaped: <html>
unescaped: <html>
User avatar
Kai
Site Admin
Posts: 1272
Joined: Tue Apr 25, 2000 1:27 pm

Un Verb

Post by Kai »

<verb noesc> will enter literal mode but without HTML-escaping, eg.:

<verb noesc>
<HTML>
$x
</verb>

will output:

<HTML>
$x
Post Reply