-
Notifications
You must be signed in to change notification settings - Fork 30
Description
Is your feature request related to a problem? Please describe.
The syntax for CDATA in xml is the following:
<example><![CDATA[This <text> won't be escaped & will be preserved as-is.]]></example>ShellAnything should support CDATA syntax so that users can easily write their action without having to escape them for xml. Often, a command is written for cmd.exe or powershell.exe. So a command cmd.exe, must be written properly for cmd.exe, escaped for cmd.exe, then escaped for xml.
For example:
<exec path="${env.ComSpec}" basedir="${env.TEMP}" arguments="/k ""${ffmpeg.install_directory}\bin\ffprobe.exe" -v verbose -hide_banner -show_streams -show_format -print_format json -i "${selection.path}""" />The command above must be escaped multiple times for different format to be properly sent to cmd.exe.
It is much difficult to read or to debug.
Describe the solution you'd like
Consider implementing CDATA syntax for the following actions:
Property
<property name="text"><![CDATA[This <text> won't be escaped & will be preserved as-is.]]></property>File
<file path="${env.USERPROFILE}\config.ini"><![CDATA[This <text> won't be escaped & will be preserved as-is.]]></file>Clipboard
<clipboard><![CDATA[This <text> won't be escaped & will be preserved as-is.]]></clipboard>Exec
<exec path="cmd.exe" wait="true">
<arguments><![CDATA[/k "echo This <text> won't be escaped & will be preserved as-is."]]></arguments>
</exec>(the child node arguments actually allow to set the xml property of the same name)
Describe alternatives you've considered
N/A
Additional context
N/A