mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 03:54:24 +01:00
Unescape Markdown Escapes inside of a link
Fixes #14968 **Bug** Due to https://github.com/chjj/marked/issues/829, markdown escapes inside of links are currently not rendered properly. This also can effect regular text that contains characters that are escaped when we convert them to markdown text. **Fix** For links, remove markdown escapes before rendering them.
This commit is contained in:
@@ -71,6 +71,12 @@ export function textToMarkedString(text: string): MarkedString {
|
||||
return text.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&'); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash
|
||||
}
|
||||
|
||||
export function removeMarkdownEscapes(text: string): string {
|
||||
if (!text) {
|
||||
return text;
|
||||
}
|
||||
return text.replace(/\\([\\`*_{}[\]()#+\-.!])/g, '$1');
|
||||
}
|
||||
|
||||
export interface IHTMLContentElement {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user