File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -13,10 +13,11 @@ import {
1313 createCommandValidator ,
1414 containsDangerousSubstitution ,
1515 protectNewlinesInQuotes ,
16+ NEWLINE_PLACEHOLDER ,
1617} from "../command-validation"
1718
1819describe ( "protectNewlinesInQuotes" , ( ) => {
19- const placeholder = "___NEWLINE___"
20+ const placeholder = NEWLINE_PLACEHOLDER
2021
2122 describe ( "basic quote handling" , ( ) => {
2223 it ( "protects newlines in double quotes" , ( ) => {
Original file line number Diff line number Diff line change @@ -2,6 +2,13 @@ import { parse } from "shell-quote"
22
33type ShellToken = string | { op : string } | { command : string }
44
5+ /**
6+ * Placeholder used to protect newlines within quoted strings during command parsing.
7+ * This constant is used by the protectNewlinesInQuotes function to temporarily replace
8+ * newlines that appear inside quotes, preventing them from being treated as command separators.
9+ */
10+ export const NEWLINE_PLACEHOLDER = "___NEWLINE___"
11+
512/**
613 * # Command Denylist Feature - Longest Prefix Match Strategy
714 *
You can’t perform that action at this time.
0 commit comments