Setting multiple attributes and escaping

Browsers override duplicate attributes. Hence an element can only have one elb, elb-<entity> and/or elb-action definition at a time. Nevertheless itโ€™s possible to define multiple entities, properties and/or actions all at once within one attribute using quotes and semicolons.

Key-value pairs are splitted by a semicolon. Therefore itโ€™s necessary to escape values containing a semicolon. Quotes are here to meet your needs. To prevent a mistaken value-split use single quotes.

<!-- value wrapping with quotes -->
<p elb="foo" elb-foo="b:a;r">{ "b": "a", "r": true }</p>
<p elb="foo" elb-foo="b:'a;r'">{ "b": "a;r" }</p>

If a single quote is part of the value escape it with a backslash:

<!-- escaping values with backslash -->
<p elb="foo" elb-foo="bar:it\'s escaped">{ "bar": "it's escaped" }</p>

The semicolon can be used as a separator to list multiple values inside of an elb-property or elb-action.

<!-- using multiple key-value pairs at once -->
<p elb="foo" elb-foo="a:1;b:2">{ "a": 1, "b": 2 }</p>