JoliTypo\Fixer::setProtectedTags PHP Method

setProtectedTags() public method

Customize the list of protected tags.
public setProtectedTags ( array $protectedTags )
$protectedTags array
    public function setProtectedTags($protectedTags)
    {
        if (!is_array($protectedTags)) {
            throw new \InvalidArgumentException('Protected tags must be an array (empty array for no protection).');
        }
        $this->protectedTags = $protectedTags;
    }

Usage Example

Exemplo n.º 1
0
 public function testProtectedTags()
 {
     $fixer = new Fixer(array('Ellipsis'));
     $fixer->setProtectedTags(array('pre', 'a'));
     $fixed_content = $fixer->fix('<p>Fixed...</p> <pre>Not fixed...</pre> <p>Fixed... <a>Not Fixed...</a>.</p>');
     $this->assertEquals('<p>Fixed&hellip;</p> <pre>Not fixed...</pre> <p>Fixed&hellip; <a>Not Fixed...</a>.</p>', $fixed_content);
 }