Jump to content

Aide:Transformations avant enregistrement

From mediawiki.org
This page is a translated version of the page Help:Pre-save transform and the translation is 4% complete.
PD Note : si vous modifiez cette page, vous acceptez de placer votre contribution sous licence CC0. Plus d’informations sont disponibles sur le projet Aide dans le domaine public. PD

When you finish editing a page on MediaWiki and click on the Publier les modifications button, the wikitext you enter may be automatically modified before it is saved. This process is called a pre-save transform (PST), and it is visible when you click on the Voir les modifications button. The visual rendering of the PST is shown when you click on the Prévisualiser button. The modified wikitext won't appear in the edit box immediately. To see the changes in the wikitext, you need to save and then press "Edit" again.

Examples

The instances in which wikitext is automatically transformed include:

  • Substitution
  • Tildes:
    • ~~~ creates a signature without including the time or date.
    • ~~~~~ provides the time and date information, such as 08:56, 2 July 2024 (UTC)
    • ~~~~ creates a complete signature, combining ~~~ and ~~~~~
  • Pipe trick

When you add this code to a template, please make sure it doesn't convert wikitext too soon, like when saving the template. One way to do this is by enclosing the split code within the template's parameters. For example:

  • {{{{{|safesubst:}}}CURRENTTIME}}
  • {{{|~~}}}~~
  • <nowiki>~~</nowiki>~~
  • [[abc (def)|{{{|}}}]]

The last example isn't very helpful, it's just there to show how it's similar to the other three examples.

Another way is using the ‎<includeonly /> tags.

You can also use a template parameter to decide when to apply the conversion during template substitution. For example, {{{{{subst1|}}}CURRENTTIME}} converts if the subst1 parameter equals subst: or safesubst:, otherwise, it doesn't if the parameter is empty or undefined.

Limits

Automatic conversions of wikitext won't happen in ‎<ref>...‎</ref> and ‎<gallery>...‎</gallery> tags.[1]

References

See also