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

blacklist for attributify #150

Open
alexanderniebuhr opened this issue May 23, 2021 · 0 comments
Open

blacklist for attributify #150

alexanderniebuhr opened this issue May 23, 2021 · 0 comments

Comments

@alexanderniebuhr
Copy link
Member

alexanderniebuhr commented May 23, 2021

processAttributify() {
// TODO: ERROR HANDLING
// TODO: Debug utils lib
// FIXME: #150 not bulletprof yet
const tmpContent = this.content
const ATTRIBUTIFY_CLASS_MATCHES = [...tmpContent.matchAll(/([\w+:_/-]+)=(['"])([!\w\s\n~:/\\,%#[\].$-]*?)\2/gi)]
// TODO: allow prefix with ::
// extract key & value as class array
if (ATTRIBUTIFY_CLASS_MATCHES.length < 1) return this
for (const match of ATTRIBUTIFY_CLASS_MATCHES) {
if (match[1] == 'class') continue
this.attributifyClassList.set(match[1].toString(), match[3].split(' '))
}
this.content = tmpContent
return this
}

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

1 participant