Misplaced Pages

Template:-?/doc

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
< Template:-?
This is a documentation subpage for Template:-?
It may contain usage information, categories and other content that is not part of the original template page.
WarningThis template is used on approximately 3,600 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them.
This template should not be used in citation templates such as Citation Style 1 and Citation Style 2, because it includes markup that will pollute the COinS metadata they produce; see Misplaced Pages:COinS.

Usage

The {{-?}} template creates a spaced question mark so as to avoid text collisions between italicized content and a non-italicized question mark. This situation may most frequently be encountered in DYK.

Example (with highlighting added for clarity)
  • Using the template:
... that ''']''' wrote '']''{{-?}}
... that Sergei Prokofiev wrote Peter and the Wolf?
  • For comparison, here is the completely unspaced version:
... that ''']''' wrote '']''?
... that Sergei Prokofiev wrote Peter and the Wolf?
  • And here is the version with a semantically incorrect non-breaking space character:
... that ''']''' wrote '']''&nbsp;?
... that Sergei Prokofiev wrote Peter and the Wolf ?
When rendered, the non-breaking-spaced version adds too much space, and improperly mixes content and presentation.

See also