Help:Pre-save transform/ja
![]() |
注意: このページを編集すると、編集内容が CC0 のもとで公開されることに同意したと見なされます。詳細はパブリック・ドメインのヘルプ ページを参照してください。 | ![]() |
When you finish editing a page on MediaWiki and click on the 変更を公開
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 差分を表示
button.
The visual rendering of the PST is shown when you click on the プレビューを表示
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 編集
again.
例
The instances in which wikitext is automatically transformed include:
- Subst展開
- Tildes:
~~~
creates a signature without including the time or date.~~~~~
provides the time and date information, such as08:56, 2 July 2024 (UTC)
~~~~
creates a complete signature, combining~~~
and~~~~~
- パイプ トリック
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.