Manual:$wgFragmentMode

From mediawiki.org
This page is a translated version of the page Manual:$wgFragmentMode and the translation is 45% complete.
出力: $wgFragmentMode
節の ID をどのように符号化するかを決定する
導入されたバージョン:1.30.0 (Gerrit change 362326; git #Id304010)
除去されたバージョン:使用中
許容される値:(配列)
既定値:[ 'html5', 'legacy', ] (1.37+)

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

[ 'legacy' ] (1.30)

Determines how section IDs should be encoded.

詳細

この配列は 1 つまたは 2 つの要素を含むことができます。各要素は以下のいずれかです:

  • 'html5' - 最小限のエスケープであるモダンな HTML5 スタイル エンコーディング。多くのブラウザーのアドレスバーにおいて Unicode 文字が表示されるようにします。
  • 'legacy' - 古い MediaWiki スタイルエンコーディング。例:手紙.E6.89.8B.E7.B4.99 になります。
  • 'html5-legacy' 非推奨$wgExperimentalHtmlIds モードに対応します。そのモードを止めるための移行以外では使用しないでください(以下を参照)。

The first element of this array specifies the primary mode of escaping IDs. This is what users will see when they e.g. follow an [[#internal link]] to a section of a page.

The optional second element defines a fallback mode, useful for 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.

Example: you want to migrate your wiki from 'legacy' to 'html5'. On the first step, set this variable to [ '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.


関連項目