Template:Sharp/doc

From OpenStreetMap Wiki
Jump to navigation Jump to search

Usage

This template gives the sharp symbol #. Use {{Sharp}} when you need a sharp symbol # inside a template. It has no parameters.

Examples

  • Works for CSS colors returned by {{#switch:}} or {{#if:}} or by templates:
    <span style="background:{{#if:1|{{Sharp}}F00}}">test</span> gives correctly:
    test
    <span style="background:{{#if:1|#F00}}">test</span> still gives correctly:
    test (it would not work if the color was returned by a template)
  • Works for plain-text literal sharp symbols at start of lines or table cells:
    {{Sharp}}x gives correctly:
    #x
    But #x gives the unexpected numbered list:
    1. x
  • Works for prefixing anchors in links:
    [[Template:Sharp{{#if:1|{{Sharp}}Examples}}|Examples]] gives correctly:
    Examples
    But [[Template:Sharp{{#if:1|#Examples}}|Examples]] gives the unexpected numbered list with a broken link:
    [[Template:Sharp
  1. Examples|Examples]]

See also