Phantasmal MUD Lib for DGD

Phantasmal Site > Phantasmal API > API Listing > trim_empty_tags

API Function: trim_empty_tags

Summary:
remove tag/block pairs with only whitespace

Defined In LPC Object:
/usr/common/obj/basic_unq_parser.c

Prototype:
mixed *trim_empty_tags(mixed *unq_data)

Can Be Called By:
Anybody

Description:

Trim empty tags out of the supplied block of UNQ data and return it. Empty tags are those with nil labels, or all-whitespace labels, and also have all-whitespace block bodies. This function is not recursive, and won't descend into UNQ block bodies to trim out empty tags inside them.

Many UNQ formats allow unlabelled whitespace but ignore it. This function can automate that process.

Return Value:

The UNQ data described above.

Errors:
Errors will occur if malformed UNQ is passed in.

See Also:
basic_unq_parse