Jump to content

Template:Text diff/doc: Difference between revisions

From Noumenapedia
→See also: Template was moved
 
m 1 revision imported
 
(No difference)

Latest revision as of 16:05, 9 September 2026

__EXPECTED_UNCONNECTED_PAGE__

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:

−
Old text.
+
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

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Text diff in articles based on its 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