Skip to content

Commit

Permalink
Add <a> to inline content set
Browse files Browse the repository at this point in the history
Fixes issue #31
  • Loading branch information
xemlock committed Apr 26, 2019
1 parent af6ce63 commit 32cef47
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion library/HTMLPurifier/HTML5Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class HTMLPurifier_HTML5Config extends HTMLPurifier_Config
{
const REVISION = 2019041501;
const REVISION = 2019042601;

/**
* @param string|array|HTMLPurifier_Config $config
Expand Down
1 change: 1 addition & 0 deletions library/HTMLPurifier/HTMLModule/HTML5/Hypertext.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public function setup($config)
'target' => new HTMLPurifier_AttrDef_HTML_FrameTarget(),
'type' => 'Text',
));
$this->addElementToContentSet('a', 'Inline');
$a->excludes = array('a' => true);
}
}
7 changes: 7 additions & 0 deletions tests/HTMLPurifier/HTMLModule/HTML5/HypertextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ public function anchorInput()
array(
'<a href="foo" download="bar">Download</a>',
),
array(
'<p>Foo <a href="foo">foo</a> bar</p>'
),
array(
'<a href="foo"><p>Foo <a href="foo">foo</a></p></a>',
'<a href="foo"><p>Foo </p></a>',
),
);
}

Expand Down

0 comments on commit 32cef47

Please sign in to comment.