mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 01:58:53 +01:00
don't create links when they won't be rendered (#248353)
dont create links when they wont be rendered
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
export function formatStackTrace(stack: string): { formattedStack: string; errorLocation?: string } {
|
||||
export function formatStackTrace(stack: string, trustHtml: boolean): { formattedStack: string; errorLocation?: string } {
|
||||
let cleaned: string;
|
||||
// Ansi colors are described here:
|
||||
// https://en.wikipedia.org/wiki/ANSI_escape_code under the SGR section
|
||||
@@ -23,7 +23,7 @@ export function formatStackTrace(stack: string): { formattedStack: string; error
|
||||
return `${prefix}${num}${suffix}\n`;
|
||||
});
|
||||
|
||||
if (isIpythonStackTrace(cleaned)) {
|
||||
if (isIpythonStackTrace(cleaned) && trustHtml) {
|
||||
return linkifyStack(cleaned);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user