Skip to content

blacklist for attributify #150

Open
Open
@alexanderniebuhr

Description

@alexanderniebuhr

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
}

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