html-sanitizer icon indicating copy to clipboard operation
html-sanitizer copied to clipboard

[FEATURE] Add possibility to declare and apply presets to behavior

Open ohader opened this issue 3 years ago • 1 comments

Example (uses preset declaring <iframe> and applies it):

use TYPO3\HtmlSanitizer\Behavior;
use TYPO3\HtmlSanitizer\Builder\Preset\IframePreset;

$behavior = (new Behavior())
    ->withFlags(Behavior::ENCODE_INVALID_TAG | Behavior::REMOVE_UNEXPECTED_CHILDREN)
    ->withName('scenario-test')
    ->withPreset(new IframePreset());

Related: #91

ohader avatar Oct 20 '22 08:10 ohader

Separate PresetInterface from specific implementations. Besides IFramePreset the might be a ScriptJsonLdPreset (#71).

ohader avatar Nov 26 '22 09:11 ohader