TargetBlank.php 522 B

12345678910111213141516171819202122232425
  1. <?php
  2. /**
  3. * Module adds the target=blank attribute transformation to a tags. It
  4. * is enabled by HTML.TargetBlank
  5. */
  6. class HTMLPurifier_HTMLModule_TargetBlank extends HTMLPurifier_HTMLModule
  7. {
  8. /**
  9. * @type string
  10. */
  11. public $name = 'TargetBlank';
  12. /**
  13. * @param HTMLPurifier_Config $config
  14. */
  15. public function setup($config)
  16. {
  17. $a = $this->addBlankElement('a');
  18. $a->attr_transform_post[] = new HTMLPurifier_AttrTransform_TargetBlank();
  19. }
  20. }
  21. // vim: et sw=4 sts=4