Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to allow custom elements using a regex #91

Closed
shaydoc opened this issue Sep 21, 2019 · 6 comments · Fixed by #92
Closed

How to allow custom elements using a regex #91

shaydoc opened this issue Sep 21, 2019 · 6 comments · Fixed by #92

Comments

@shaydoc
Copy link

shaydoc commented Sep 21, 2019

I need to be able to whitelist elements based up a regex pattern
The reason for this is because I have lots of web components.
E.g. {namespace}-my-element

I would like to white list anything containing {namespace} pattern

Can this be achieved easily?

@buro9
Copy link
Member

buro9 commented Sep 21, 2019

This is a good requirement. Do you have examples of the HTML input and what you'd like the output to be.

@shaydoc
Copy link
Author

shaydoc commented Sep 21, 2019

Sure,
All I want to be able to do is

 p.AllowElements(regexp.MustCompile(`my-namepsace-*`))

So Data In

  <div>
      <my-namespace-demo-one />
      <my-namespace-demo-two />
      <not-my-namespace-demo-one />
  </div>

Data Out

  <div>
      <my-namespace-demo-one />
      <my-namespace-demo-two /> 
  </div>

@shaydoc
Copy link
Author

shaydoc commented Oct 3, 2019

what ya think @buro9 , would this be an easy update to make?

@theflyingcodr
Copy link
Contributor

I'm working on this one at the moment, hope to have a PR up today for 👀 and feedback

@theflyingcodr
Copy link
Contributor

Little bit later than I'd have liked due to other commitments, but PR is now in for this #92

@shaydoc
Copy link
Author

shaydoc commented Oct 21, 2019

be good to get this merged @buro9

@buro9 buro9 closed this as completed in #92 Nov 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants