fix(util): allow escapeInlineCode to escape double backtics (#7638)

* fix(util): allow scapeInlineCode to escape double backtics

* fix: replace backtics properly

* chore: fix lint
This commit is contained in:
Parbez
2022-03-25 01:30:04 +05:30
committed by GitHub
parent 9a6e691eaa
commit d5369a56e3

View File

@@ -189,7 +189,7 @@ class Util extends null {
* @returns {string}
*/
static escapeInlineCode(text) {
return text.replaceAll('`', '\\`');
return text.replace(/(?<=^|[^`])``?(?=[^`]|$)/g, match => (match.length === 2 ? '\\`\\`' : '\\`'));
}
/**