mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 17:21:39 +09:00
Fix #2271 data-file-srl attribute of <video> and <audio> tags
This commit is contained in:
parent
e2cfa524d0
commit
2d1ff01688
2 changed files with 10 additions and 0 deletions
|
|
@ -353,6 +353,8 @@ class HTMLFilter
|
|||
|
||||
// Support editor components and widgets.
|
||||
$def->addAttribute('img', 'data-file-srl', 'Number');
|
||||
$def->addAttribute('video', 'data-file-srl', 'Number');
|
||||
$def->addAttribute('audio', 'data-file-srl', 'Number');
|
||||
$def->addAttribute('img', 'editor_component', 'Text');
|
||||
$def->addAttribute('div', 'editor_component', 'Text');
|
||||
$def->addAttribute('img', 'rx_encoded_properties', 'Text');
|
||||
|
|
|
|||
|
|
@ -273,6 +273,14 @@ class HTMLFilterTest extends \Codeception\Test\Unit
|
|||
$target = '<p><img src="foo.jpg" alt="foobar" /></p>';
|
||||
$this->assertEquals($target, Rhymix\Framework\Filters\HTMLFilter::clean($source));
|
||||
|
||||
$source = '<video src="foo.mp4" poster="foo.jpg" data-file-srl="1234"></video>';
|
||||
$target = '<video src="foo.mp4" poster="foo.jpg" data-file-srl="1234"></video>';
|
||||
$this->assertEquals($target, Rhymix\Framework\Filters\HTMLFilter::clean($source));
|
||||
|
||||
$source = '<audio src="foo.mp3" invalid="" data-file-srl="1234"></audio>';
|
||||
$target = '<audio src="foo.mp3" data-file-srl="1234"></audio>';
|
||||
$this->assertEquals($target, Rhymix\Framework\Filters\HTMLFilter::clean($source));
|
||||
|
||||
// Other data-* attribute
|
||||
$source = '<div data-foo="foobar" data-bar="bazz" style="width:100%;">Hello World</div>';
|
||||
$target = '<div style="width:100%;" data-foo="foobar" data-bar="bazz">Hello World</div>';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue