From 32cef47500fb77c2be0f160372095bec15bf0052 Mon Sep 17 00:00:00 2001 From: xemlock Date: Fri, 26 Apr 2019 10:47:13 +0200 Subject: [PATCH] Add to inline content set Fixes issue #31 --- library/HTMLPurifier/HTML5Config.php | 2 +- library/HTMLPurifier/HTMLModule/HTML5/Hypertext.php | 1 + tests/HTMLPurifier/HTMLModule/HTML5/HypertextTest.php | 7 +++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/library/HTMLPurifier/HTML5Config.php b/library/HTMLPurifier/HTML5Config.php index 2b7d6cc..30c717d 100644 --- a/library/HTMLPurifier/HTML5Config.php +++ b/library/HTMLPurifier/HTML5Config.php @@ -2,7 +2,7 @@ class HTMLPurifier_HTML5Config extends HTMLPurifier_Config { - const REVISION = 2019041501; + const REVISION = 2019042601; /** * @param string|array|HTMLPurifier_Config $config diff --git a/library/HTMLPurifier/HTMLModule/HTML5/Hypertext.php b/library/HTMLPurifier/HTMLModule/HTML5/Hypertext.php index 543f40b..afa301d 100644 --- a/library/HTMLPurifier/HTMLModule/HTML5/Hypertext.php +++ b/library/HTMLPurifier/HTMLModule/HTML5/Hypertext.php @@ -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); } } diff --git a/tests/HTMLPurifier/HTMLModule/HTML5/HypertextTest.php b/tests/HTMLPurifier/HTMLModule/HTML5/HypertextTest.php index a4c87fd..c70e5dd 100644 --- a/tests/HTMLPurifier/HTMLModule/HTML5/HypertextTest.php +++ b/tests/HTMLPurifier/HTMLModule/HTML5/HypertextTest.php @@ -23,6 +23,13 @@ public function anchorInput() array( 'Download', ), + array( + '

Foo foo bar

' + ), + array( + '

Foo foo

', + '

Foo

', + ), ); }