User:Opencooper/Wikitext gotchas

Wikipedia's markup, wikitext, is parsed into HTML that is rendered on the page. On this page I will list common markup mistakes made that do not output what would be the expected markup or better practices.

Gotchas

edit
  • The colon is widely abused to indent text. It should not be used in this manner. See User:Opencooper/Proper indentation.
  • Spaces between list items (unordered, ordered and definition lists) actually create a new list element for each item instead of grouping them all as part of a single list. To fix this, delete blank lines between the items. The same applies for images in between, as well as blockquotes. For these, move them to precede the list or consider whether the list format is appropriate for whatever is being attempted.
  • 's after an bolded/italicized phrase actually includes the apostrophe as part of the formatting and not the "s". A fix for this is to use the template {{'s}} or {{'}}, which also kerns the end of the word properly.
  • Two blank lines or more creates a paragraph consisting solely of a break. The br element in HTML is meant for line breaks in things that require them (poems, addresses) and not to separate paragraphs. The spacing is also usually unintentionally added or used to properly space images. Blank lines should be removed. To fix floating elements, see {{Clear}}.
  • In infoboxes, different list items will often be separated by breaks, like cast lists. Lists in the infobox should instead use appropriate list templates like {{Plainlist}} or {{hlist}}.
  • Sometimes lists with multiple columns are achieved using tables. This should instead be done using CSS via templates like {{Div col}}.
  • Sometimes poems are put inside pre tags in order to preserve line breaks. However this puts the poem in a monospaced font and that element is more suited towards code. Instead, use <poem> inside of a <blockquote> (see also {{Poemquote}}).
  • Two or more spaces in front of a paragraph also wraps that paragraph inside of a pre tag which results in unwanted formatting. For quotations, use <blockquote> and otherwise delete leading spaces. (multiple spaces between sentences are ignored by the parser so those are fine)
  • To link to pages in other Wikipedia languages, prefix the language code with a colon or else the parser will think that the page you are linking is a interlanguage version of the current page. So [[:ja:テスト]] and not [[ja:テスト]]. (instead of piping the link, consider using {{ill}})

See also

edit