Remove unescaping from #or

Context

As presented in the extension documentation, escape sequences (and associated <esc> tags) allow to delay wikitext parsing.

The original ParserFunctions functions do not unescape their parameters (and return value), so this extension adds variations of these functions to do this additional step. These are called (and supposed to work) the same way, with an ue prefix (i.e. #ueif, #ueifeq and #ueswitch).

This extension also adds a #or parser function, which is supposed to be a variant of the #if parser function. On top of the traditional #if operations, it also unescapes its parameters.

Motivation

The name of the #or parser function, when mixed with other ParserFunctions functions, does not directly suggest that escaping is performed.

In the case where escaping is not desired, this extension does not provide an alternative to using the #if parser function.

Proposed Changes

  • rename #or to #ueor,
  • add a new #or parser function which does not unescape.

Examples

Current behavior:

<esc>|</esc>                            <!-- gives  \!  -->

{{#if:   <esc>|</esc> | <esc>|</esc> }} <!-- gives  \!  -->
{{#or:   <esc>|</esc> }}                <!-- gives  |   -->

{{#ueif: <esc>|</esc> | <esc>|</esc> }} <!-- gives  |   -->

Proposed behavior:

<esc>|</esc>                            <!-- gives  \!  -->

{{#if:   <esc>|</esc> | <esc>|</esc> }} <!-- gives  \!  -->
{{#or:   <esc>|</esc> }}                <!-- gives  \!  -->

{{#ueif: <esc>|</esc> | <esc>|</esc> }} <!-- gives  |   -->
{{#ueor: <esc>|</esc> }}                <!-- gives  |   -->
Edited by Adrien LESÉNÉCHAL

Merge request reports

Loading