View/Edit #52:tag_implode_args

Switch to edit mode.

Name(s): tag_implode_args
1:  "Builds a tag out of a list of the name, properties and arguments."
2:  "eg: {'A', {'HREF','/passwd'}, 'NOROBOTS', {'TARGET','_new'}}"
3:  "=> '<A HREF='/passwd' NOROBOTS TARGET='_new'>'"
4:  tag = "<"
5:  if (!args)
6:    return ""
7:  endif
8:  for arg in (args)
9:    if (typeof(arg) == $LIST)
10:     {name, value} = arg
11:     if (typeof(value) != $STR)
12:       value = this:literal_text(value)
13:     else
14:       value = tostr(value)
15:     endif
16:     tag = tostr(tag, name, "=\"", value, "\" ")
17:   else
18:     tag = tostr(tag, arg, " ")
19:   endif
20: endfor
21: return tag[1..$ - 1] + ">"
22: "Last modified by Dax (#789) on Fri Dec 16 19:56:39 2005 MST."

Verb arguments: this none this
Verb perms: Readable eXecutable NOT-Debug
Verb owned by: Hacker (#60)

You are not logged in.

[home | help | who | search | setup | code]