This template file contains the regular expressions for all replacements codes.

There has been a helpful and clarifying discussion if this template opens a security loophole. I couldn’t see it myself at first, but the bottom line is simply: No, not at all.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
{{
.
| replaceRE `\{\^([^\}]*)\}` "<sup>$1</sup>"
| replaceRE `\{\_([^\}]*)\}` "<sub>$1</sub>"
| replaceRE `\{\#([^\}]*)\}` "<kbd>$1</kbd>"
| replaceRE `\{\!([^\}]*)\}` "<mark>$1</mark>"
| replaceRE `\{\=([^\}]*)\}` "<cite>$1</cite>"
| replaceRE `\{\+([^\}]*)\}` "<ins>$1</ins>"
| replaceRE `\{\$([^\}]*)\}` "<var>$1</var>"
| replaceRE `\{s\s?([^\}]*)\}` "<small>$1</small>"
| replaceRE `\{r\s?([^\}]*)\}` "<span style='float: right;'>$1</span>"
| replaceRE `\{d\s?([^\}]*)\}` "<span lang='de'>$1</span>"
| replaceRE `\{f\s?([^\}]*)\}` "<span lang='fr'>$1</span>"
| replaceRE `\s?( — |&mdash;)\s?` "  —  "
| replaceRE `(<p[^>]*>|<li[^>]*>)([“«»„])` "$1<span class='hang-quote'>$2</span>"
| safeHTML
}}