(attrs: HtmlTagDescriptor['attrs'])
| 1638 | } |
| 1639 | |
| 1640 | function serializeAttrs(attrs: HtmlTagDescriptor['attrs']): string { |
| 1641 | let res = '' |
| 1642 | for (const key in attrs) { |
| 1643 | if (typeof attrs[key] === 'boolean') { |
| 1644 | res += attrs[key] ? ` ${key}` : `` |
| 1645 | } else { |
| 1646 | res += ` ${key}="${escapeHtml(attrs[key])}"` |
| 1647 | } |
| 1648 | } |
| 1649 | return res |
| 1650 | } |
| 1651 | |
| 1652 | function incrementIndent(indent: string = '') { |
| 1653 | return `${indent}${indent[0] === '\t' ? '\t' : ' '}` |
no test coverage detected