mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03:00

Before this patch, code like this would break generate invalid XML: lib.generators.toPlist {} "ab<cd" That's obviously bad, since the call to toPlist often happens through indirection, as is the case in e.g. the nix-darwin project. A user might not realize that they have to escape the strings. This patch adds the argument 'escape' to lib.generators.plist and emits a warning if it is not set to true. In a future release, this behavior should become the default. I have also added a note for future maintainers, in case I forget to actually remove the deprecated functionality in a future release.
48 lines
No EOL
974 B
Text
48 lines
No EOL
974 B
Text
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
<plist version="1.0">
|
|
<dict>
|
|
<key>nested</key>
|
|
<dict>
|
|
<key>values</key>
|
|
<dict>
|
|
<key>attrs</key>
|
|
<dict>
|
|
<key>foo b/ar</key>
|
|
<string>baz</string>
|
|
</dict>
|
|
<key>bool</key>
|
|
<true/>
|
|
<key>emptyattrs</key>
|
|
<dict>
|
|
|
|
</dict>
|
|
<key>emptylist</key>
|
|
<array>
|
|
|
|
</array>
|
|
<key>emptystring</key>
|
|
<string></string>
|
|
<key>float</key>
|
|
<real>0.133700</real>
|
|
<key>int</key>
|
|
<integer>42</integer>
|
|
<key>keys are not <escaped></key>
|
|
<string>and < neither are string values</string>
|
|
<key>list</key>
|
|
<array>
|
|
<integer>3</integer>
|
|
<integer>4</integer>
|
|
<string>test</string>
|
|
</array>
|
|
<key>newlinestring</key>
|
|
<string>
|
|
</string>
|
|
<key>path</key>
|
|
<string>/foo</string>
|
|
<key>string</key>
|
|
<string>fn${o}"r\d</string>
|
|
</dict>
|
|
</dict>
|
|
</dict>
|
|
</plist> |