Skip to content

Commit dee520f

Browse files
author
Andrew Davis
committed
Add some additional rendering options from xmlbuilder to the documentation
See https://github.com/oozcitak/xmlbuilder-js/wiki#converting-to-string
1 parent e8540dc commit dee520f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,11 +333,13 @@ Possible options are:
333333

334334
* `rootName` (default `root` or the root key name): root element name to be used in case
335335
`explicitRoot` is `false` or to override the root element name.
336-
* `renderOpts` (default `{ 'pretty': true, 'indent': ' ', 'newline': '\n' }`):
336+
* `renderOpts` (default `{ 'pretty': true, 'indent': ' ', 'newline': '\n', 'allowEmpty': false, 'spacebeforeslash': '' }`):
337337
Rendering options for xmlbuilder-js.
338338
* pretty: prettify generated XML
339339
* indent: whitespace for indentation (only when pretty)
340340
* newline: newline char (only when pretty)
341+
* allowEmpty: allow empty tags like <root></root> instead of self-closing them like <root/> (only when pretty)
342+
* spacebeforeslash: add the given space character(s) into self-closed tags like <root /> (only when pretty)
341343
* `xmldec` (default `{ 'version': '1.0', 'encoding': 'UTF-8', 'standalone': true }`:
342344
XML declaration attributes.
343345
* `xmldec.version` A version number string, e.g. 1.0

0 commit comments

Comments
 (0)