Pre-save transforms (PST) are transformations which are applied to the content before it is even saved.
They are implemented in the function preSaveTransform()
of the appropriate Content
subclass.
Wikitext
For {{ll|Manual:WikitextContent.php|Wikitext content}}, the {{ll|Manual:Parser.php|parser}}’s preSaveTransform()
applies the following transformations, in order:
- Null characters
- Null characters are removed.
- Trailing whitespace
- Whitespace (according to PHP's rtrim()) at the end of the text is removed.
- Line endings
- Line endings
\r\n
as well as\r
are normalized to\n
. - Substitutions
{{subst: template name| template parameters}}
- Signatures
~~~
,~~~~
and~~~~~
− Note that this order has the nontrivial effect of not allowing template substitutions within a signature.- Pipe trick
-
[[phabricator:T1|]]
becomes[[phabricator:T1|T1]]
[[title (topic)|]]
becomes[[title (topic)|title]]
JSON
JsonContent::preSaveTransform()
applies the following transformations, in order:
- Beautify JSON
- standardizes the formatting (“pretty”, i. e. split across lines and indented)
- Line endings
- Line endings
\r\n
as well as\r
are normalized to\n
.
This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.