Index: trunk/phase3/maintenance/parserTests.txt |
— | — | @@ -8146,7 +8146,19 @@ |
8147 | 8147 | |
8148 | 8148 | !! end |
8149 | 8149 | |
| 8150 | +!! test |
| 8151 | +HTML5 data attributes |
| 8152 | +!! input |
| 8153 | +<span data-foo="bar">Baz</span> |
| 8154 | +<p data-abc-def_hij="">Quuz</p> |
| 8155 | +!! result |
| 8156 | +<p><span data-foo="bar">Baz</span> |
| 8157 | +</p> |
| 8158 | +<p data-abc-def_hij="">Quuz</p> |
8150 | 8159 | |
| 8160 | +!! end |
| 8161 | + |
| 8162 | + |
8151 | 8163 | TODO: |
8152 | 8164 | more images |
8153 | 8165 | more tables |
Index: trunk/phase3/includes/Sanitizer.php |
— | — | @@ -627,7 +627,7 @@ |
628 | 628 | * @todo Check for unique id attribute :P |
629 | 629 | */ |
630 | 630 | static function validateAttributes( $attribs, $whitelist ) { |
631 | | - global $wgAllowRdfaAttributes, $wgAllowMicrodataAttributes; |
| 631 | + global $wgAllowRdfaAttributes, $wgAllowMicrodataAttributes, $wgHtml5; |
632 | 632 | |
633 | 633 | $whitelist = array_flip( $whitelist ); |
634 | 634 | $hrefExp = '/^(' . wfUrlProtocols() . ')[^\s]+$/'; |
— | — | @@ -643,7 +643,8 @@ |
644 | 644 | continue; |
645 | 645 | } |
646 | 646 | |
647 | | - if( !isset( $whitelist[$attribute] ) ) { |
| 647 | + # Allow any attribute beginning with "data-", if in HTML5 mode |
| 648 | + if ( !($wgHtml5 && preg_match( '/^data-/i', $attribute )) && !isset( $whitelist[$attribute] ) ) { |
648 | 649 | continue; |
649 | 650 | } |
650 | 651 | |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -146,6 +146,7 @@ |
147 | 147 | * (bug 11005) Add CSS class to empty pages in Special:Newpages |
148 | 148 | * The parser cache is now shared amongst users whose different settings aren't |
149 | 149 | used in the page. |
| 150 | +* Any attribute beginning with "data-" can now be used in wikitext, per HTML5. |
150 | 151 | |
151 | 152 | === Bug fixes in 1.17 === |
152 | 153 | * (bug 17560) Half-broken deletion moved image files to deletion archive |