Issue Task Closed

#94797Enhance documentation for integration of html-sanitizer

Tomas Norre Mikkelsen 08/11/21, 05:35 updated 10/07/21, 07:14

Description

The example

class MyCustomBuilder extends DefaultSanitizerBuilder implements BuilderInterface
{
    public function createBehavior(): Behavior
    {
        // extends existing behavior, adds new tag
        return parent::createBehavior()
            ->withName('my-custom')
            ->withTags(
                (new Behavior\Tag('my-element', Behavior\Tag::ALLOW_CHILDREN))
                ->addAttrs(
                    (new Behavior\Attr('href'))->addValues(
                        new Behavior\RegExpAttrValue('#^(?:https?://|mailto:)#')
                    ),
                    ...$this->globalAttrs
                )
            );
        }
    }
}

from https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/9.5.x/Important-94484-IntroduceHTMLSanitizer.html

has one too many } in the example

Reviews 5