menu: support CDATA for <command> element

...in order to support obmenu-generator output such as this:

  <menu id="root-menu" label="Applications">
    <item label="File Manager"><action name="Execute"><command><![CDATA[xdg-open .]]></command></action></item>
    <item label="Terminal"><action name="Execute"><command><![CDATA[xterm]]></command></action></item>
    <item label="Web Browser"><action name="Execute"><command><![CDATA[xdg-open http://]]></command></action></item>
    <item label="Run command"><action name="Execute"><command><![CDATA[gmrun]]></command></action></item>
  </menu>

References:
- https://github.com/trizen/obmenu-generator
- https://aur.archlinux.org/packages/obmenu-generator
- https://trizenx.blogspot.com/2012/02/obmenu-generator.html

Fixes: issue #972
This commit is contained in:
Johan Malm 2023-07-02 21:17:26 +01:00 committed by Johan Malm
parent 2bbeea0fc2
commit 49dfba1507
2 changed files with 40 additions and 4 deletions

View file

@ -48,7 +48,8 @@ A menu file must be entirely enclosed within <openbox_menu> and
The visible name of the menu item.
*menu.item.action*
See labwc-action(5)
See labwc-action(5). Note: XML CDATA is supported for this node in
order to maintain compatibility with obmenu-generator.
*menu.separator*
Horizontal line.