Pipe character not fully escaped within "code blocks", causes issues in tables

Steps to reproduce

When storing a command or another piece of code that contains a pipe character within a table, it appears to not be fully escaped.

Create a table → |Something|Something|

insert a piece of “code block” that contains a pipe character as the left side or right-side of the two column table. For example here is a Bash code block with multiple pipes.

for ext in $(echo ".xls .xls* .xltx .csv .od* .doc .doc* .pdf .pot .pot* .pp*");do echo -e "\nFile extension: " $ext; find / -name *$ext 2>/dev/null | grep -v "lib|fonts|share|core" ;done

Put another you want on the other side of the table, fully completing the table requirements. Then once moving into the next row, the table will display but its messed up. See attacked images pip-test-1, and pipe-test-2

You can fix this by using the escape characters on the pipes. This works to stop the table-attempting to finish a cell. This shows that the behaviors are not fully escaped, as the escape character shows up as itself in the code block, but still works to break the pipe’s effect. See image pipe-test-3. The code block looks like this after escaping all the pipes:

for ext in ${echo ".xls .xls* .xltx .csv .od* .doc .doc* .pdf .pot .pot* .pp*");do echo -e "\nFile extension: " $ext; find / -name *$ext 2>/dev/null \| grep -v "lib\|fonts\|share\|core" ;done

Expected result

The desired result is that when pipe characters are within a code-block, there effects are fully escaped. So I can make respective tables with commands | definitions.

Actual result

Have to escape the pipe characters, then the commands look odd, because they now also show the escape characters before the pipes…ie ( | ). Visually this is ugly, and can be confusing if these notes are going to a different user than the one writing them.


Obsidian version: v1.1.9
Installer version: v1.0.3
Operating system: Windows 10 Home 10.0.22621
Login status: not logged in
Insider build toggle: off
Live preview: on
Legacy editor: off
Base theme: dark
Community theme: none
Snippets enabled: 0
Restricted mode: off
Plugins installed: 0
Plugins enabled: 0


Additional information

if you search “pipe table” in the forum, what do you find?

1 Like

Lols, rough day have we? Mark this as closed, due to ass.

Did you find the solution when searching?

It’s often good to present that here, or a reference to it, so that others stumbling upon this can see it.

And you’re able to mark this as solved yourself by hitting the solution check box, sometimes hidden behind the three dits at the end of replies.

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