Skip to content

Add deeper srcset attribute support - #91

Open
ssddanbrown wants to merge 1 commit into
xemlock:masterfrom
ssddanbrown:master
Open

Add deeper srcset attribute support#91
ssddanbrown wants to merge 1 commit into
xemlock:masterfrom
ssddanbrown:master

Conversation

@ssddanbrown

Copy link
Copy Markdown

Hello!
In usage, I noticed that the library added support for srcset attributes, but currently just defines these as text.
These attributes can contain (and load content) from URLs, so I thought it'd be ideal to have proper parsing of srcset attributes to validate their format, while ensuring the URLs contained within follow configured HTMLPurifier URI rules.

This adds WHATWG-based parsing for srcset attributes so that values can be validated, and so the URIs used can be validated against HTMLPurifier rules.

All code had been manually written by me.
I've tried to ensure I'm following project conventions, but just let me know if changes need to be made.
I've added a range of tests in an attempt to ensure coverage and logic validity.

This adds WHATWG based parsing for srcset attributes so that values can
be validated, and so the URIs used can be validated against HTMLPurifier
rules.
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 this pull request may close these issues.

1 participant