I noticed that it is not possible to use symbols [ and ] in a single string without the string in between the symbols being converted into a link. Normally it should be possible to add a \ before the ] symbol to make sure, confluence doesn't recognize the string as a link, but this is not possible with the extension.
I have taken a look at the codebase and found the regex expression used for this operation.
I believe that by adding a negative lookbehind and checking if a \ precedes the ] symbol, it should be possible to ignore that ] symbol completely. The regex in question can be found at line 97 in this file . The update I propose is the following..
# OLD
let re = /\[([^|]*)?\|?([^|]*)\]/g
# NEW
let re = /\[([^|]*)?\|?([^|]*)(?<!\\)\]/g
It should also be easy to add a new regex to check for \], and replace those with ].
A regex for this replacement can be/\\\]\g which would be able to find all \] matches.
If you would like a pull request with these changes, let me know :)
Hi,
I noticed that it is not possible to use symbols [ and ] in a single string without the string in between the symbols being converted into a link. Normally it should be possible to add a \ before the ] symbol to make sure, confluence doesn't recognize the string as a link, but this is not possible with the extension.
I have taken a look at the codebase and found the regex expression used for this operation. I believe that by adding a negative lookbehind and checking if a \ precedes the ] symbol, it should be possible to ignore that ] symbol completely. The regex in question can be found at line 97 in this file . The update I propose is the following..
It should also be easy to add a new regex to check for
\]
, and replace those with ]. A regex for this replacement can be/\\\]\g
which would be able to find all\]
matches.If you would like a pull request with these changes, let me know :)