ExtractStyleBlocks does not support @media
Open
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 3.4k
- Forks
- 361
- Avg merge
- 3d 41m
- Merged PRs (30d)
- 2
Description
$purifier = new \HTMLPurifier($config);
$config = \HTMLPurifier_Config::createDefault();
$config->set('Filter.ExtractStyleBlocks', true);
$purifier = new \HTMLPurifier($config);
$clean_html = $purifier->purify(<<<HELLO
<style> @media print {
div { color:red}
} div { font-size:3em}</style><div>abc</div>
HELLO);
$styles = $purifier->context->get('StyleBlocks');
var_dump($styles);
Outputs
array(1) {
[0]=>
string(21) "div {
font-size:3em
}"
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files or tests. Start by running the PHP reproduction and tracing the ExtractStyleBlocks path that produces StyleBlocks; done means the extracted output preserves the @media print block alongside the existing div rule.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100