mirror of
https://git.quad4.io/RNS-Things/MeshChatX.git
synced 2026-05-11 03:06:55 +00:00
Add ESLint disable comments for regex patterns in MarkdownRenderer.js to address security concerns
This commit is contained in:
@@ -18,6 +18,7 @@ export default class MarkdownRenderer {
|
||||
|
||||
// Fenced code blocks - process these FIRST and replace with placeholders
|
||||
const code_blocks = [];
|
||||
// eslint-disable-next-line security/detect-unsafe-regex -- bounded fenced block, lazy match
|
||||
text = text.replace(/```(\w+)?\n([\s\S]*?)\n```/g, (match, lang, code) => {
|
||||
const placeholder = `[[CB${code_blocks.length}]]`;
|
||||
code_blocks.push(
|
||||
@@ -91,6 +92,7 @@ export default class MarkdownRenderer {
|
||||
}
|
||||
|
||||
// Strip fenced code blocks
|
||||
// eslint-disable-next-line security/detect-unsafe-regex -- bounded fenced block, lazy match
|
||||
text = text.replace(/```(\w+)?\n([\s\S]*?)\n```/g, "[Code Block]");
|
||||
|
||||
// Strip headers
|
||||
|
||||
Reference in New Issue
Block a user