Page MenuHomePhabricator

Definition syntax cannot be escaped and is potentially unintended.
Closed, ResolvedPublic

Description

Author: jesdisciple

Description:
I was just writing a template and was surprised when syntax similar to `{{#ifeq:{{{param|}}}|value||; text here}}. More text here.' was emboldened and given its own paragraph. I was separating an optional statement off from the main sentence. Having never used definitions before and therefore clueless why this happened, I took a guess and removd the semicolon. Aha! After Googling a bit, I found what the semicolon was for through the bug about the inappropriate <dl/> indentation caused by the colon. Parser functions like this apparently begin new lines (or at least new matches) implicitly for every pipe, and thus I was seeing behavior I didn't explicitly ask for.

Workaround: Use the HTML entity &#59; (&#58; for colon) instead.

I suggest that:

  • the "beginning of line" behavior of parser functions (and presumably templates) be rewritten so only an explicit newline begins a new match; and/or
  • escape sequences be designed for the semicolon and colon at the match start, like maybe ;; and :; (additional semicolon for both).

Version: 1.14.x
Severity: enhancement

Details

Reference
bz19302

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:43 PM
bzimport set Reference to bz19302.
bzimport added a subscriber: Unknown Object (MLST).

jesdisciple wrote:

On second thought, that second suggestion would leave other syntax elements such as * and # broken. Maybe the traditional \ (backslash) would be best. It could be simply ignored, except for its escaping nature, at a line's start.

a.d.bergi wrote:

:; would not be a good escape sequence, as it has its own syntactical sense.

*** This bug has been marked as a duplicate of bug 12974 ***