Tables: Add alias/display name without requiring escaping the pipe sign \|

Use case or problem

Obsidian doesn’t support wikilink renames in tables without escaping the pipe.

Proposed solution

The parser should detect if it is inside wikilink brackets.

Current workaround

I’m not aware of a workaround for this except escaping.

Related feature requests

There are a lot of other posts reporting this as a bug or otherwise people having issues with this.

1 Like

I second this. It is counterintuitive for several reasons, one of them being a violation of the original wikitext spec from which wikilinks are borrowed. The fact that there are numerous threads on this already shows that this is a thing that commonly trips people.
Also, auto-completion for aliased files in tables does not escape the pipe and thus produces broken links. One may or may not consider this to be a bug, but - most importantly - it would also be fixed by implementing this FR.
The bug Pipe Problems in tables: Live Preview doesn't play well with escaped alias mentioned by OP would also be resolved.

Edit: There appears to be another FR for this feature: Use of aliases in tables
Maybe the FRs should be merged.

Using internal links with aliases in a table will break the table rendering because the “|” defining the alias will be interpreted as “next cell”.

column 1 column 2 column 3
[[link alias]] text

Is there a way to make the “|” divider in internal links compatible with the “|” divider in tables?

1 Like

You have to escape it with \. So [title\|alias]

1 Like

Indeed it works. So simple that it didn’t come to my mind :laughing:
Thank you

To me this feels like a bug. Obsidian could check that if there is [[ open when a | character appears in a table, the | character should be considered to relate to the [[ link element, and not to the table structure.

Escaping the | character seems like a workaround to me, not an actual solution :slight_smile:. (But good that at least a workaround exists already).

These are just my opinions.

2 Likes

Block level elements take precedence over span elements, so table syntax is correctly processed before links.

https://spec.commonmark.org/0.30/#precedence

Steps to reproduce

  1. Create a table with an internal link using custom text using a |

Expected result

I expect that Live Preview and Reading mode would have the same behavior for custom internal link text where the pipe character needs to be escaped, like the help page describes.

Actual result

Links that are missing an escape before the pipe render and work in Live Preview, but do not work in Reading View.

Source

Reading View (Expected Behavior)

Screenclip_2022-01-21 11.19.24_5X11bX

Live Preview (Broken Link Renders)

Screenclip_2022-01-21 11.18.57_bq67wp

Environment

  • Operating system: MacOS Monterrey
  • Debug info:
SYSTEM INFO:
	Obsidian version: v0.13.21
	Installer version: v0.12.15
	Operating system: Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:54 PST 2021; root:xnu-8019.61.5~1/RELEASE_X86_64 21.2.0
	Login status: logged in
	Catalyst license: supporter
	Insider build toggle: on
	Live preview: on
	Legacy editor: off
	Base theme: dark
	Community theme: none
	Snippets enabled: 0
	Safe mode: on

Additional information

I’m new to Obsidian, and this came up when I was trying to add custom internal link text in a table for the first time.

I understand now that an escape character is required, but the different behavior between Live Preview and Reading View initially made it harder for me to determine what the problem was. The correct formatting would be clearer to new users if the link also did not work without an escape character in Live Preview.

It’s possible that at some point we don’t require escaping for reader to work.

will be implemented in v1.5.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.