I would like to add the support for other HTML attributs. the defaults are too basic and do not allow to pass a lot of data from our data sources (ajax result).
create a variable DATA_ATTRIBUTE_PATTERN at line 41
add this variable in the global attributs allowed
var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
var DATA_ATTRIBUTE_PATTERN = /^data-[\w-]*$/i;
var DefaultWhitelist = {
// Global attributes allowed on any supplied element below.
'*': ['class', 'dir', 'id', 'lang', 'role', 'tabindex', 'style', ARIA_ATTRIBUTE_PATTERN, DATA_ATTRIBUTE_PATTERN],
The outcome would be the following for each line of result:
< a role="option" id="bs-select-1-1" tabindex="0" aria-setsize="4" aria-posinset="2"> < span class="text"> < div **data-name="test" data-ori="test" data-id="1604"** class="bbbb">Test TEST 1604</div > < /span> < /a>
I would like to add the support for other HTML attributs. the defaults are too basic and do not allow to pass a lot of data from our data sources (ajax result).
The outcome would be the following for each line of result:
< a role="option" id="bs-select-1-1" tabindex="0" aria-setsize="4" aria-posinset="2"> < span class="text"> < div **data-name="test" data-ori="test" data-id="1604"** class="bbbb">Test TEST 1604</div > < /span> < /a>