mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 12:04:04 +01:00
htmlContent.textToMarkedString: Convert plainText to MarkedString
This commit is contained in:
@@ -67,8 +67,8 @@ function markedStringEqual(a:MarkedString, b:MarkedString): boolean {
|
||||
);
|
||||
}
|
||||
|
||||
export function textAsCodeBlock(text: string) : MarkedString {
|
||||
return { language: 'string', value: text };
|
||||
export function textToMarkedString(text: string) : MarkedString {
|
||||
return text.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&'); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user