Template:Hif/doc

Usage
This template detects if a character string begins with a #.

This template is based on ignoring any sections and looking only at if the page exists.

By default, the template returns a "1" if it starts with a hash sign, or a "0" otherwise. By inputing the "then" and "else" parameters, you can choose to output a string instead. These returns can then be used in switch or other templates, or directly in what you are using, to generate the desired effect. The template has undefined behavior if any pages starting with "Template:Hif" exist (including subpages).

Chiefly, this template is designed to fix a certain error that occurs when using HTML Colour Codes (e.g. "#345342"), which is, quite simply, that in certain cases, WikiMarkup takes the "#xxxxxx" to mean:


 * 1) xxxxxx

which is obviously not desired. This template can be used to catch Colour Codes that have been entered with the "#" character, then to avoid an error by replacing with xxxxxx (in most cases an HTML Colour Code does not actually require a #).