How to escape `|` in code

I’m using logseq to write my university notes, and it’s been great, apart from one problem. I seem unable to escape the | character. I’m trying to create a table of different operators, so I need to add this character in to it within an inline code section e.g `\|`. However, the render of this is not respecting the backslash and is instead just beginning the next column of the table. In any other markdown renderer I’ve tried, this just works. Is there another way of escaping the character that I could try. For now, I’m using $\mid$ to get the latex character, but I can’t put this in a code block.

Thank you

For context, this is my table:

This is what happens when I try to use regular \|:

Two workarounds:

  • this html: <code>&#124;</code>
  • the vertical line character:
1 Like

The html won’t work inside an inline code block, and I’ve already tried the vertical line character, it being in a table takes precedence over a code block

  • The html is for custom output.
    • It is visually identical to the html produced by Logseq.
      • But you have to type the whole code-block yourself.
  • By “vertical line character” I mean the special character used in ASCII drawing.
    • Compare these four vertical lines: l I | │
      • The first one is the lower case letter L, i.e. l
      • The second one is the capital letter i, i.e. I
      • The third one is the separator that Logseq fails to escape, i.e. |
      • The fourth one is the special character, i.e.
        • Other than being bigger, it works fine.

The <code> creates the inline block you’re seeking, mentioned by mentaloid

| type | operators |
| bitwise | <html><code>&#124;</code></html> |

or even

| type | operators |
| bitwise | <html><code>&verbar;</code></html> |

image