Skip to content

Commit 069dc45

Browse files
committed
Add YAML parser to callback builder
1 parent da36b00 commit 069dc45

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎src/builder/XMLBuilderCBImpl.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export class XMLBuilderCBImpl extends EventEmitter implements XMLBuilderCB {
107107
p3?: AttributesObject): this {
108108

109109
// parse if JS object or XML or JSON string
110-
if (isObject(p1) || (isString(p1) && (/^\s*</.test(p1) || /^\s*[\{\[]/.test(p1)))) {
110+
if (isObject(p1) || (isString(p1) && (/^\s*</.test(p1) || /^\s*[\{\[]/.test(p1) || /^(\s*|(#.*)|(%.*))*---/.test(p1)))) {
111111
const frag = fragment().set(this._options as unknown as Partial<XMLBuilderOptions>)
112112
try {
113113
frag.ele(p1 as any)

0 commit comments

Comments
 (0)