(
{ tag, attrs, children }: HtmlTagDescriptor,
indent: string = '',
)
| 1612 | const unaryTags = new Set(['link', 'meta', 'base']) |
| 1613 | |
| 1614 | function serializeTag( |
| 1615 | { tag, attrs, children }: HtmlTagDescriptor, |
| 1616 | indent: string = '', |
| 1617 | ): string { |
| 1618 | if (unaryTags.has(tag)) { |
| 1619 | return `<${tag}${serializeAttrs(attrs)}>` |
| 1620 | } else { |
| 1621 | return `<${tag}${serializeAttrs(attrs)}>${serializeTags( |
| 1622 | children, |
| 1623 | incrementIndent(indent), |
| 1624 | )}</${tag}>` |
| 1625 | } |
| 1626 | } |
| 1627 | |
| 1628 | function serializeTags( |
| 1629 | tags: HtmlTagDescriptor['children'], |
no test coverage detected