humanmade / humanmade/clean-html

Syntax for allowed tags and attributes

Open
#3 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
46
Forks
0
PR merge metrics
No merged PRs in 30d

Description

I've been thinking about the way I'd like to specify allowed tags and their attributes. Specifying a comma-separated list of allowed tags is fine, but in order to specify allowed attributes you need to use KSES's array syntax, which is awfully verbose.

I'd like to use a CSS-like syntax with attribute names appearing in square brackets:

`a[href][rel], strong, em`

This could even be extended to support KSES's bizarre attribute value functionality:

`a[href="valueless:n"][rel][target], strong, em`

This is a concise syntax and should be familiar to anyone who's familiar with CSS selectors.

Thoughts?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.