mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-02-25 02:02:44 +00:00
KSES: Add support for <ruby> and related elements.
`<ruby>` element and its friends are used to attach annotation text onto a piece of text. This is especially commonly used in Japanese content, but it can also been seen in content of other languages like Chinese. The set of elements to enable such functionality consists of `<ruby>`, `<rt>`, and `<rp>` in the [https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-ruby-element HTML Standard], while some browsers (like Firefox) additionally support `<rb>` and `<rtc>` for more advanced formatting, which are not yet included in the official HTML spec, but can be found in a [https://www.w3.org/TR/html-ruby-extensions/ W3C extension]. Props upsuper, mukesh27, SergeyBiryukov. Fixes #54698. git-svn-id: https://develop.svn.wordpress.org/trunk@52969 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
e7a9f9df4e
commit
26c7b2b079
@ -249,6 +249,11 @@ if ( ! CUSTOM_TAGS ) {
|
||||
'q' => array(
|
||||
'cite' => true,
|
||||
),
|
||||
'rb' => array(),
|
||||
'rp' => array(),
|
||||
'rt' => array(),
|
||||
'rtc' => array(),
|
||||
'ruby' => array(),
|
||||
's' => array(),
|
||||
'samp' => array(),
|
||||
'span' => array(
|
||||
|
||||
@ -861,7 +861,7 @@ EOF;
|
||||
/**
|
||||
* @ticket 34063
|
||||
*/
|
||||
public function test_bdo() {
|
||||
public function test_bdo_tag_allowed() {
|
||||
global $allowedposttags;
|
||||
|
||||
$input = '<p>This is <bdo dir="rtl">a BDO tag</bdo>. Weird, <bdo dir="ltr">right?</bdo></p>';
|
||||
@ -869,10 +869,21 @@ EOF;
|
||||
$this->assertSame( $input, wp_kses( $input, $allowedposttags ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 54698
|
||||
*/
|
||||
public function test_ruby_tag_allowed() {
|
||||
global $allowedposttags;
|
||||
|
||||
$input = '<ruby>✶<rp>: </rp><rt>Star</rt><rp>, </rp><rt lang="fr">Étoile</rt><rp>.</rp></ruby>';
|
||||
|
||||
$this->assertSame( $input, wp_kses( $input, $allowedposttags ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 35079
|
||||
*/
|
||||
public function test_ol_reversed() {
|
||||
public function test_ol_reversed_attribute_allowed() {
|
||||
global $allowedposttags;
|
||||
|
||||
$input = '<ol reversed="reversed"><li>Item 1</li><li>Item 2</li><li>Item 3</li></ol>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user