Topic: [Bug] Pipe character (|) breaks wiki dtext ([[]]) parsing in certain cases

Posted under Site Bug Reports & Feature Requests

Bug overview description.
Pipe character (|) behaves oddly within wiki link dtext ([[]])

What part(s) of the site page(s) are affected?
Any page where wiki dtext can be linked/parsed

What is the expected behavior?
Clickable wiki links

What actual behavior is given instead?
Linked wiki dtext breaks, not clickable

  • [[:|]]
  • [[:\||:\|]]
  • [[:\||wiki link]]

Time of incident (if applicable).
n/a

Can you reproduce the bug every time?
Yes

What steps did you take to replicate this bug?

[[:|]]
[[:\\||:\|]]
[[:\\||wiki link]]
 

see tag group:facial expressions#emotes

Errors or other messages returned (if any).
n/a

Updated

Also related is trying to escape the pipe

--

* [[:o]]
* [[:\\|]]
* [[:I]]
 

Updated by anonymous

..also related is trying to escape a pipe within \

dtext 
(unsure if bug)

[code] 
* [[:o]]
* [[:\|]]
* [[:I]]
 

actual input:

* [[:o]]
* [[:\\|]]
* [[:I]]
 

edit hahah i had to edit this post like 5 times

Updated by anonymous

titanmelon said:
..also related is trying to escape a pipe within \

dtext 
(unsure if bug)

[code] 
* [[:o]]
* [[:\|]]
* [[:I]]
 

actual input:

* [[:o]]
* [[:\\|]]
* [[:I]]
 

edit hahah i had to edit this post like 5 times

Looks like a bug to me, \` inside code blocks (

`) shouldn't be interpreted.
Aside from `\\[`, which is necessary to allow literal `
inside a code block, and

\\\`, which is needed for literal \`. EDIT: Found another bug. [ code ] inside backticks actually activates! (that's why the above looks so weird and the literal [ code ] is missing) You can work around it with escaping: \

` ( the [ is escaped), but it seems like it's never what you'd want.

IMO the real bug expressed in OP is "the ability to create a link with an empty title". I'd suggest that links with an empty title, like `[[:|]]`, should have their title set to `link`, like this : [[:|link]]

Since, you know, pipe characters are part of how link names work in dtext.

The behaviour in your second post is clear: the escaped | is unescaped too early, so that it is interpreted in the exact same way as the unescaped version (link with no title)

Updated by anonymous

If I understand it correctly, placing a | in a wiki link causes it to display as whatever is placed after the |. If you put nothing after the|, it will display what you told it to display: nothing.
Eg. \this displays "this" while \[[dingo|]] displays "[[dingo|]]". So it's not really a bug.

Wait, it displayed the second one as if I escaped it entirely. What the?

Updated by anonymous

It is a bug because there's no sensible use of a link that has no title -- unless you want it to only be activateable via the keyboard (the second link in TitanMelon's second post is accessible by tabbing onto it and pressing enter).
Admins already removed the possibility to post topics with zero printable length for similar reasons.

But yeah, there seem to be multiple escaping-related bugs interacting here.

Hmm

Breakage tests:

  • [[;|]]
  • [[$|]] [[%|]] [[&|]] [[!|]] [[@|]] [[#|]] [[(|]] [[)|]] [[;|]] (punctuation)
  • [[\\|]]
  • \\] : broken, actual string is [[\\]]], which could be interpreted as either a link to the wiki for ] or just plain broken -> shouldn't be interpreted at all.

[[;|]]

What even.

The above is OP's bugged link, which is posting as just-not-a-link-at-all... ???

normal sane link test

I can still reproduce the second post case : This invisible link here: [[;\|]] , which refers to the wiki page for ;

Updated by anonymous

savageorange said:
I can still reproduce the second post case : This invisible link here: [[;\|]] , which refers to the wiki page for ;

The ", which refers to the wiki page for ;" part didn't show up in your comment. It somehow cancelled everything after the \\.
Nevermind. It showed up properly... the second time.

Updated by anonymous

I guess that might be a variant on the 'spaces vanish / everything after a https link vanishes.. and then everything is normal when you reload' known bug, but I'd always understood that only applies to your-own-message-that-you've-just-posted, not other peoples.

EDIT:
Ooh wait, Titanmelon, when you say "Linked wiki dtext breaks, not clickable", do you mean a) there is nothing there so it's impossible to click on it, or b) the markup is treated as literal text and does not become any kind of link, even a zero-length one?
Might be good to clarify that.

Updated by anonymous

Yeah, I see that all the time on my own newly posted/edited posts but never on anyone elses.

Updated by anonymous

Genjar

Former Staff

Check the formatting help...
| is the escape character for custom titles.

So [[:|]] is interpreted as : with blank custom text. Probably easy to fix, since there's no reason to actually allow blank text.

Updated by anonymous

Genjar said:
Check the formatting help...
| is the escape character for custom titles.

So [[:|]] is interpreted as : with blank custom text. Probably easy to fix, since there's no reason to actually allow blank text.

Then why did my example of [[dingo|]] go through as if the whole thing was escaped? There's no \ before it yet you can see the whole thing.

Updated by anonymous

Genjar

Former Staff

BlueDingo said:
Then why did my example of [[dingo|]] go through as if the whole thing was escaped?

Ah, I see. I misunderstood the problem.
Yeah, looks like it doesn't work at all if the custom text field is empty. Which is preferable to displaying nothing, but doesn't allow linking to valid tags such as :|. ...we don't have any other tags that end in |, so fortunately that's not a big deal.

By the way, that reminds me: tags that end in : are broken. I don't know the details, but that's why check_tag_type isn't getting implicated, etc.

Updated by anonymous

.. I really wouldn't call | an escape character. Optional divider, maybe.

EDIT:
To clarify, escapes normally are used to insert some kind of special feature into a text, not modify an existing part of the text. When thinking about it, I would say they are an optional divider that functions as markup, basically in the exact reverse way to html (In html, the link is the markup. In dtext, the custom title is the markup)

Updated by anonymous

I actually didn't remember that | is the optional divider at the time of posting!
(wikipedia doesn't seem to have a name for this @savageorange)

[[:\\||:\|]]
[[:\\||wiki link]]
 

doesn't seem to work either:

[[:\||:\|]]
[[:\||wiki link]]

----

  • Updated OP
    • added 'in certain cases' in title, since they supposedly still work for everything else

Updated by anonymous

  • 1