Sha256: e2a1546beb72436ac91c2c90f4afcfd5f7a016d39e159169f9d45f06e1ffee20
Contents?: true
Size: 476 Bytes
Versions: 17
Compression:
Stored size: 476 Bytes
Contents
import { htmlAttributes } from "../html/html-attributes"; export class Span { attributes: Record<string, any>; children: any[]; constructor(attributes: Record<string, any> = {}) { this.children = []; this.attributes = attributes; } get render(): string { return `<span ${htmlAttributes(this.attributes)}>${this.children.map(child => child.render).join("")}</span>`; } add(child: any): Span { this.children.push(child); return this; } }
Version data entries
17 entries across 17 versions & 1 rubygems