WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Support xml's CDATA syntax for some actions. #188

@end2endzone

Description

@end2endzone

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 &quot;&quot;${ffmpeg.install_directory}\bin\ffprobe.exe&quot; -v verbose -hide_banner -show_streams -show_format -print_format json -i &quot;${selection.path}&quot;&quot;" />

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions