Template:Highlight
Template:Highlight
This optional template displays inline text with a soft yellow background to draw attention during drafting or review. It is not intended to appear in published articles and should be removed before publication.
Highlighting is shown only when:
- The page is in any talk namespace (e.g. Talk:, User talk:, etc.)
- The page is a sandbox subpage (i.e. ends with
/sandbox, case-insensitive) - The page is tagged as a draft using {{develop}}, {{review}}, or {{tasks}}
In all other cases, the text is displayed normally without highlighting.
Usage
The template accepts either unnamed content or a named text= parameter. Both forms work:
- {{highlight|Some text to highlight}}
- {{highlight|text=Some text to highlight}}
The template also supports a visibility=hidden parameter. When set, the markup remains but the visual highlight is suppressed:
- {{highlight|text=This will not be highlighted|visibility=hidden}}
This can be used when preparing an article for review by hiding highlighted markup while keeping the text readable.
Examples
- {{highlight|Text to highlight}}
- {{highlight|text=Alternate syntax}}
- {{highlight|text=Highlight suppressed|visibility=hidden}}
Renders as:
- Text to highlight
- Alternate syntax
- Highlight suppressed: Highlight suppressed
Note for reviewers
EzPR 2025 uses this template as part of its sentence marking functionality. It will also silently remove it when publishing.
All occurrences of this template in an article must be separately removed before publishing if using the legacy easyPeerReview, as the template, even when output is suppressed, will remain in the published article.
There are two options to manage the template broadly (all occurrences in a given article):
MarkupManager
User:Michael.C.Wright/MarkupManager is an interface based on javascript written specifically to allow one to scan for and remove all occurrences of the template from an article.
TemplateScript
TemplateScript[1] is a tool based on javascript that can be used to manipulate all occurrences of {{Highlight}}, while editing the article, with a single click. It was not specifically intended for this use but it does work.
The following code works:
{
name: 'Remove {{Highlight}} template',
script: function (editor) {
// Remove all occurrences of {{highlight}} / {{Highlight}} etc.,
// preserving underlying text from |text= or first unnamed parameter.
editor.replace(/{{\s*highlight([^}]*)}}/gi, function (match, params) {
if (!params) {
// No parameters: nothing to preserve, just drop the template
return '';
}
// Drop leading "|", then split into parameters
var paramStr = params.replace(/^\s*\|/, '');
var parts = paramStr.split('|');
var textParam = '';
var firstUnnamed = '';
for (var i = 0; i < parts.length; i++) {
var trimmed = parts[i].trim();
if (!trimmed) continue;
var eqIndex = trimmed.indexOf('=');
if (eqIndex === -1) {
// Unnamed parameter
if (!firstUnnamed) {
firstUnnamed = trimmed;
}
} else {
var name = trimmed.slice(0, eqIndex).trim().toLowerCase();
var value = trimmed.slice(eqIndex + 1); // preserve original spacing/case
if (name === 'text' && !textParam) {
textParam = value;
}
}
}
var innerText = textParam || firstUnnamed || '';
// Return only the preserved text; template markup is removed
return innerText;
});
editor.appendEditSummary('Remove all instances of the {{Highlight}} template, preserving underlying text.');
},
enabled: true
},