| This is a documentation subpage for Template:Text diff. It may contain usage information, categories and other content that is not part of the original template page. |
__EXPECTED_UNCONNECTED_PAGE__
| This template uses Lua: |
This template can be used to show proposed changes, e.g. on talk pages.
Usage
<syntaxhighlight lang="wikitext">{{Text diff|Old text.|New text.}}</syntaxhighlight> produces a diff showing the changes:
| − | + | New text. |
Warning
The template uses a sentinel value to detect whether it has been filled out properly when inserted via Template:Request edit button/preload. Using the sentinel value produces a warning message:
<syntaxhighlight lang="wikitext">{{Text diff|ORIGINAL_WIKITEXT|CHANGED_WIKITEXT}}</syntaxhighlight>
Warning Unnamed parameter <syntaxhighlight lang="wikitext" inline style="display: none;" />|1= set to default value. Please change it. Failure to use {{Text diff}} to specify your requested text changes, if not adequately described above, may lead to your request being denied.
Limitations
This template is suitable only for comparing a single in-line string of text. Use of this template to compare multi-line content (i.e. HTML block content, text including line breaks) will result in syntax errors.
This template must be placed on a new line, i.e. with a line break before the template. Adding the template to a line that is indented with a colon or asterisk may result in syntax errors.
TemplateData
TemplateData for Text diff
<templatedata> { "params": { "1": { "label": "Old text", "description": "Specify the old wikitext here.", "type": "line", "required": true }, "2": { "label": "New text", "description": "Specify the new wikitext here.", "type": "line", "required": true } }, "description": "This template compares two texts. The comparison is formatted similarly to a \"diff\" (see Help:Diff).", "format": "block" } </templatedata>
See also
- User:NguoiDungKhongDinhDanh/FormattedEditRequest, a script for automatically producing diffs similar to the ones produced by this template
- {{String diff}}, which produces character-level diffs