This appears to be an upstream issue with the markdown parser used for previewing and extracting links, because if you have a table with a cell that contains both something that could be mistaken for a wikilink and one or more vertical bars, the document’s local graph will show the not-a-wikilink. For example:
| Ways of Reading Stdout | Linux | OS X (bash 3.2) | Windows |
| ------------------------------ | --------: | --------------: | -------: |
| `REPLY=$(builtin-or-func...)` | 1187/s | 1369/s | 65/s |
| `read -r < <(builtin-or-f...)` | 2048/s | 1690/s | 68/s |
| `spork read -r -- builtin...` | 6842/s | 5649/s | 3514/s |
| `spork pair w r; builtin...` | 9960/s | 10162/s | 5481/s |
| `[[ ${spork-} ]] || spork ...` | 40433/s | 33840/s | 17667/s |
| Total Performance Improvement | 34.1x | 24.7x | 271.8x |
The editor syntax highlighting handles this table correctly, showing the [[ ${spork-} ]] ||
line with the correct table separators styled as cm-hmd-table-sep
. But the local graph pane will show a bogus link to a nonexistent page named ${spork-}
, and the preview mangles the display. This suggests a difference in parsing between the markdown parser used for editing and the one used for previews/metadata extraction.
It looks like maybe Obsidian is using remark-parse version 8? If that’s the case, then this issue was a relevant upstream issue. It appears that this was because they deliberately chose to reproduce a Github upstream bug, but they did not reproduce the Github workaround (which is to backslash-escape the pipe symbols).
Apparently, on Github, backslash-escaping the pipe symbols stops them being interpreted as table delimiters, but the cell parsing then unescapes them before doing low-level parsing, so the cell contents are correctly interpreted as not being escaped (so you don’t render the backslashes). Remark’s attempt to mimic Github’s behavior doesn’t do this, so you end up with bogus backslashes in the rendering.
I have reported the issue upstream as remarkjs/remark #583, so hopefully it can be fixed there, though in all probability this will require Obsidian to upgrade to the newest remark-parse, which has a very different API than the version Obsidian currently appears to be using. But if that is done, then it should fix this for math, latex, and inline code using pipe characters in table cells.