match all, not just first instance of tokens to escape
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
@@ -53,7 +53,7 @@ function parseLink(a: HTMLAnchorElement, partCreator: PartCreator) {
|
||||
if (href === a.textContent) {
|
||||
return partCreator.plain(a.textContent);
|
||||
} else {
|
||||
return partCreator.plain(`[${a.textContent.replace(/[[\\\]]/, c => "\\" + c)}](${href})`);
|
||||
return partCreator.plain(`[${a.textContent.replace(/[[\\\]]/g, c => "\\" + c)}](${href})`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user