Skip to content

Custom config class #60

@danaki

Description

@danaki

I'm moving a project to Symfony4 from other framework where it defined like so:

<?php

namespace A\Namespace;

class HTMLPurifierConfig extends \HTMLPurifier_Config
{
    public static function create($config, $schema = null)
    {
        $ret = parent::create($config, $schema);

        $def = $ret->getHTMLDefinition(true);

        $def->info_tag_transform['div'] = new \HTMLPurifier_TagTransform_Simple('p');
        $def->info_tag_transform['h1'] = new \HTMLPurifier_TagTransform_Simple('h4');
        $def->info_tag_transform['h2'] = new \HTMLPurifier_TagTransform_Simple('h5');
        $def->info_tag_transform['h3'] = new \HTMLPurifier_TagTransform_Simple('h6');

...

Is it possible to introduce a config setting to override standard \HTMLPurifier_Config with a custom one from bundle config?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions