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