ezyang / ezyang/htmlpurifier

Image width percentages in CSS

Open
#448 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
3.4k
Forks
361
Avg merge
3d 41m
Merged PRs (30d)
2

Description

I discovered that htmlpurifier doesn't support width percentages in CSS on tags. I needed this badly for my current project and found this answer which worked:
https://stackoverflow.com/questions/77137822/html-purifier-not-allowing-height-and-width-in-img-tag-style-attribute/77141710#77141710

Is this oversight accidental or purposeful?

If I went to the work of creating a patch using this code, would it be accepted into the project? If so, I'm willing to do it.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how HTMLPurifier validates CSS width and height values on img style attributes, then compare the linked Stack Overflow workaround with the project's existing behavior. Done means percentage-based dimensions are accepted safely and covered by a regression test; the issue names no specific files or tests, so locating those entry points is part of the work.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
security, web-dev
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.