(attribs)
| 1 | function attrString(attribs) { |
| 2 | const buff = [] |
| 3 | for (const key in attribs) { |
| 4 | buff.push(`${key}="${attribs[key]}"`) |
| 5 | } |
| 6 | if (!buff.length) { |
| 7 | return '' |
| 8 | } |
| 9 | return ` ${buff.join(' ')}` |
| 10 | } |
| 11 | |
| 12 | function escapeXmlText(str) { |
| 13 | return str.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>') |