mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-22 09:46:42 +02:00
fix: CodeQL double escape warning
This commit is contained in:
@@ -372,8 +372,8 @@ export const addLinks = function (actorId: string, text: { text: string }) {
|
|||||||
// JSON.parse the text
|
// JSON.parse the text
|
||||||
try {
|
try {
|
||||||
let sanitizedText = sanitizeText(text.text, getConfig());
|
let sanitizedText = sanitizeText(text.text, getConfig());
|
||||||
sanitizedText = sanitizedText.replace(/&/g, '&');
|
|
||||||
sanitizedText = sanitizedText.replace(/=/g, '=');
|
sanitizedText = sanitizedText.replace(/=/g, '=');
|
||||||
|
sanitizedText = sanitizedText.replace(/&/g, '&');
|
||||||
const links = JSON.parse(sanitizedText);
|
const links = JSON.parse(sanitizedText);
|
||||||
// add the deserialized text to the actor's links field.
|
// add the deserialized text to the actor's links field.
|
||||||
insertLinks(actor, links);
|
insertLinks(actor, links);
|
||||||
@@ -389,8 +389,8 @@ export const addALink = function (actorId: string, text: { text: string }) {
|
|||||||
const links: Record<string, string> = {};
|
const links: Record<string, string> = {};
|
||||||
let sanitizedText = sanitizeText(text.text, getConfig());
|
let sanitizedText = sanitizeText(text.text, getConfig());
|
||||||
const sep = sanitizedText.indexOf('@');
|
const sep = sanitizedText.indexOf('@');
|
||||||
sanitizedText = sanitizedText.replace(/&/g, '&');
|
|
||||||
sanitizedText = sanitizedText.replace(/=/g, '=');
|
sanitizedText = sanitizedText.replace(/=/g, '=');
|
||||||
|
sanitizedText = sanitizedText.replace(/&/g, '&');
|
||||||
const label = sanitizedText.slice(0, sep - 1).trim();
|
const label = sanitizedText.slice(0, sep - 1).trim();
|
||||||
const link = sanitizedText.slice(sep + 1).trim();
|
const link = sanitizedText.slice(sep + 1).trim();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user