discord-wiki-bot icon indicating copy to clipboard operation
discord-wiki-bot copied to clipboard

Inconsistent link embeds with [[]] and {{}}

Open zsotroav opened this issue 3 years ago • 2 comments

When requesting a URL with [[<page>]] or {{<page>}} the bot usually doesn't show the page embed. However, this is inconsistent when the bot has to "think".

Expected result: [[Template:Babel]], {{Babel}}, and {{Template:Babel}} all return the same link without any embeds shown

Actual result: The embed is visible when using {{Template:Babel}}

Affected versions:

  • Fandom MediaWiki pages (Tested on multiple wikis, including CC)
  • wikipedia.org

Additional remarks:

  • The bot "thinks" (reacts with ⌛ ) before sending the link with the embed visible
  • The bot responds with the link for the page Babel (instead of Template:Babel) when requesting {{Babel}} on wikipedia.org

image

zsotroav avatar Jan 08 '22 16:01 zsotroav

{{<page>}} was originally intended to embed the page under that name (like !wiki <page>) and the fallback to template links was only added later.

  • {{Babel}} is looking for a page named "Babel" in the main namespace, doesn't find anything and then falls back to "Template:Babel" which exists and is only linked.
  • {{Template:Babel}} is looking for a page named "Template:Babel" which exists and is therefor fully embedded. The fallback for template links is not triggered.

I know this is unintuitive and annoying for normal users and wiki editors alike and I have been planning to overwork the inline links for a while but just didn't get to it yet.

Markus-Rost avatar Jan 12 '22 20:01 Markus-Rost

Okay, I think I understand that, but the inconsistency error is still present.

Putting aside the question of intuitive design, {{Babel}} and {{Template:Babel}} should return the same result with the embed in this context.

But on the side of intuitive design, {{<page>}} should, in my opinion, prioritize templates

zsotroav avatar Jan 12 '22 21:01 zsotroav