Manuel:$wgFragmentMode

From mediawiki.org
This page is a translated version of the page Manual:$wgFragmentMode and the translation is 65% complete.
Sortie: $wgFragmentMode
Détermine la manière dont les ID des sections seront encodés
Introduit dans la version :1.30.0 (Gerrit change 362326; git #Id304010)
Retiré dans la version :Encore utilisé
Valeurs autorisées :(tableau)
Valeur par défaut :[ 'html5', 'legacy', ] (1.37+)

[ 'legacy', 'html5' ] (1.31-1.36)

[ 'legacy' ] (1.30)

Détermine la manière dont les ID des sections seront encodés.

Détails

Ce tableau contient 1 ou 2 éléments, chacun d'eux pouvant avoir une valeur parmi :

  • 'html5' - modern HTML5 style encoding with minimal escaping. Displays Unicode characters in many browsers' address bars.
  • 'legacy' - ancien style d'encodage de MediaWiki, par exemple 手紙 devient .E6.89.8B.E7.B4.99.
  • 'html5-legacy' corresponds to the DEPRECATED $wgExperimentalHtmlIds mode. DO NOT use it for anything but migration off that mode (see below).

Le premier élément du tableau indique le mode primaire d'échappement des IDs. C'est ce que voient les utilisateurs quand par exemple ils suivent un [[#internal link]] vers une section de page.

Le second élément qui est optionnel, définit un mode de repli et sert lors des migrations. If present, it will direct MediaWiki to add an empty ‎<span> to every section with its id attribute set to the fallback-encoded title so that links using the previous encoding still works.

Exemple : vous souhaitez migrer votre wiki de 'legacy' vers 'html5'. A la première étape, mettre cette variable à [ 'legacy', 'html5' ]. After a while, when all caches (parser, HTTP, etc.) contain only pages generated with this setting, flip the value to [ 'html5', 'legacy' ]. This will result in all internal links being generated in the new encoding while old links (both external and cached internal) will still work. After a long time, you might want to ditch backwards compatibility and set it to [ 'html5' ]. After all, pages get edited, breaking incoming links no matter which fragment mode is used.


Voir aussi