* @return String
*/
static function escapeId( $id, $options = array() ) {
- global $wgExperimentalHtmlIds;
+ global $wgHtml5, $wgExperimentalHtmlIds;
$options = (array)$options;
- if ( $wgExperimentalHtmlIds && !in_array( 'legacy', $options ) ) {
+ if ( $wgHtml5 && $wgExperimentalHtmlIds && !in_array( 'legacy', $options ) ) {
$id = preg_replace( '/[ \t\n\r\f_\'"&]+/', '_', $id );
$id = trim( $id, '_' );
if ( $id === '' ) {
* @private
*/
function formatHeadings( $text, $origText, $isMain=true ) {
- global $wgMaxTocLevel, $wgContLang, $wgExperimentalHtmlIds;
+ global $wgMaxTocLevel, $wgContLang, $wgHtml5, $wgExperimentalHtmlIds;
$doNumberHeadings = $this->mOptions->getNumberHeadings();
$showEditLink = $this->mOptions->getEditSection();
# Save headline for section edit hint before it's escaped
$headlineHint = $safeHeadline;
- if ( $wgExperimentalHtmlIds ) {
+ if ( $wgHtml5 && $wgExperimentalHtmlIds ) {
# For reverse compatibility, provide an id that's
# HTML4-compatible, like we used to.
#