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:
Matt Bierner
2016-12-06 15:07:13 -08:00
parent d167728610
commit 59ccb985cd
2 changed files with 10 additions and 1 deletions

View File

@@ -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 {
/**