Skip to content

Commit

Permalink
Also allow arrays of UnsafeXML
Browse files Browse the repository at this point in the history
  • Loading branch information
jcbrand committed Feb 25, 2025
1 parent 8bc48ac commit 5db788c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/stanza.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,13 @@ export class Stanza extends Builder {
acc +
str +
(Array.isArray(value)
? value.map((v) => (v instanceof Builder ? v : xmlescape(v.toString()))).join('')
? value
.map((v) =>
value instanceof UnsafeXML || value instanceof Builder
? v
: xmlescape(v.toString())
)
.join('')
: value instanceof UnsafeXML || value instanceof Builder
? value
: xmlescape((value ?? '').toString()))
Expand Down

0 comments on commit 5db788c

Please sign in to comment.