Skip to content
This repository was archived by the owner on Feb 26, 2026. It is now read-only.

Specifying allowedAttributes as a glob #4

Description

@kumarharsh

Hello there,

First of all, thank you for this nifty little tool. It's really easy to use :)
I'd like to know if it's possible to specify a list of allowed attributes as a glob (or using the wildcard *).

One use-case would be to let users enter some HTML, with special tags for some elements, such as: or . Then, while rendering them out (in a different view), I'd compile these elements into stand-alone widgets and show them. This would be particularly useful with angularjs, as I would be able to specify a widget in the form of a simple directive:

<div data-wg-timer
    data-wg-timer-start="14-May-2014"
    data-wg-timer-end="19-May-2014">
        {{days}} Days, {{hours}}:{{minutes}}:{{seconds}}
</div>

Now, in this case, I'd require multiple attributes to specify the different options I'd like to pass into the directive. So instead of specifying each allowedAttribute as a comma-separated list like so: ['data-wg-timer', 'data-wg-timer-start', 'data-wg-timer-end'], I want a way to specify the same as so: ['data-wg-*']

Is it possible, or doable?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions