I create Markdown Tables in Obsidian and often have a link to an Obsidian page as the content of one of the cells. I also frequently use Aliases to make the names more readable.
The ideal option would be to develop an Obsidian plugin, but if you are at the point of asking the how, this is probably a step too far. Therefor you either want to grab the content, process it and put it back (e.g. Via the clipboard), or in the Markdown file - but then you would have to determine which file in order to process it.
The algorithm would probably be something like use regular expression matching to match the double square brackets containing the pipe but not preceded by a Slash, with the double square bracketed string being on the same line as starts and ends up ith pipes (should match a table row usually). Then replace such matches to include the Slash before the pipe I the double square brackets.
Regular expressions are your friend. Your choice of language may further suggest an approach, but if you have say Keyboard Maestro, that could offer you ways to trigger and run this in-app or file interactions.
OK, that’s a great start. I was thinking about using KM. Here’s where I got stuck.
I don’t know how to get KM to look back on the existing page and grab text.
Would it make sense for me to just copy the line to the clipboard, run the regex on the text on the clipboard and then paste it back? Or is there an easier way to access the text to run the regex?
I guess the other option would be to use keystrokes in KM to select all and copy, process the whole file at once then paste it back…
I agree that the plugin for Obsidian is a step too far for me at this point!
I think rather than the line, process the whole text, and yes, select all, copy, process (regex replace)
and paste back the result. Key press activation is probably best, or maybe menu items if they behave well.
One thing I would note is that Keyboard Maestro supports named clipboard, so you can keep your system clipboard intact if you make use of those.