Package TWiki::Attrs

Class of attribute sets, designed for parsing and storing attribute values
from a TWiki tag e.g. %TAG{fred='bad' "sad" joe="mad"}%

An attribute set is a map containing an entry for each parameter. The
default parameter (unnamed quoted string) is named _DEFAULT in the map.

Attributes declared later in the string will override those of the same
name defined earlier. The one exception to this is the _DEFAULT key, where
the first instance of a setting is always taken.

As well as standard TWiki syntax (parameter values double-quoted)
it also parses single-quoted values, unquoted spaceless
values, spaces around the =, and commas as well as spaces separating values,
though none of these alternatives is advertised in documentation and
the extended syntax can be turned off by passing the 'strict' parameter
to new.

This class replaces the old TWiki::extractNameValuePair and
TWiki::extractParameters.

$friendly - if true, the parse will be according to the extended syntax pioneered by the original Contrib::Attrs. Otherwise it will be strict as per traditional TWiki syntax.

Parse a standard attribute string containing name=value pairs and create a new
attributes object. The value may be a word or a quoted string. If there is an
error during parsing, the parse will complete but $attrs->{_ERROR} will be
set in the new object. $attrs->{_RAW} will always contain the full unprocessed
$string.

Legacy support, formerly known as extractNameValuePair. This
static method uses context information to determine how a value
string is to be parsed. For example, if you have an attribute string
like this: