Created a function named "escapeString" that will remove or replace characters appropriately depending on their context. The function wraps select fields that can contain unwanted markdowns but not ones with intentional markdowns.
Strings inside of a code-block remain the same except for the removal of all back-ticks (`).
Strings outside of code-blocks use the regular expression "[*|_>~]" to replace each respective character with a black-slash and then itself.
The function also removes all occurrences of "```" to remove unintentional code-blocks, although this will probably never be used, it is there just in case.
Created a function named "escapeString" that will remove or replace characters appropriately depending on their context. The function wraps select fields that can contain unwanted markdowns but not ones with intentional markdowns.
Strings inside of a code-block remain the same except for the removal of all back-ticks (`). Strings outside of code-blocks use the regular expression "[*|_>~]" to replace each respective character with a black-slash and then itself.
The function also removes all occurrences of "```" to remove unintentional code-blocks, although this will probably never be used, it is there just in case.