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

ignoreTag could be an array and contain css selectors #139

Open
b-gyula opened this issue Nov 7, 2022 · 2 comments
Open

ignoreTag could be an array and contain css selectors #139

b-gyula opened this issue Nov 7, 2022 · 2 comments

Comments

@b-gyula
Copy link
Contributor

b-gyula commented Nov 7, 2022

Instead of ignoreTag it could be named ignoreTags and allow to contain CSS selectors like other posthtml plugins as posthtml-match-helper accepts [tag]#[id].[class]. E.g div#id. It would not require the developers to insert extra wrapper tags and modify the html at all. E.g. with

const options = { ignoredTags: ['div#id','.ignore'] }

would not alter

<div id='id' data-attrib='{{attribute}}'>and {{content}} not meant to be altered</div>

or

<div class='.ignore' data-attrib='{{attribute}}'>and {{content}} not meant to be altered</div>

at all.

Further more similarly other ...Tags options could use the same logic similarly to Angular Structural directive like

<div *ngIf="[condition]"></div>
@cossssmin
Copy link
Member

I like the idea, though changing its name would mean a breaking change. Maybe we could do ignoredSelectors or something until the next major release, what do you think @Scrum?

@Scrum
Copy link
Member

Scrum commented Dec 20, 2022

I think the logical approach is ignoredSelectors. We can also make an interim release in which we explicitly indicate the deprecation of the parameter ignoreTag and an exception in future releases.

You must also specify that ignoredSelectors will include the parameter value ignoreTag.

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

No branches or pull requests

3 participants