(content: string, html: SimpleHtml)
| 126 | } |
| 127 | |
| 128 | const encloseInTag = (content: string, html: SimpleHtml): string => { |
| 129 | switch (html._tag) { |
| 130 | case "Bold": { |
| 131 | return `<strong>${content}</strong>` |
| 132 | } |
| 133 | case "Color": { |
| 134 | return `<span style="color:${colorToHex(html.color)}">${content}</span>` |
| 135 | } |
| 136 | case "Italicized": { |
| 137 | return `<em>${content}</em>` |
| 138 | } |
| 139 | case "Paragraph": { |
| 140 | return `<p>${content}</p>` |
| 141 | } |
| 142 | case "Header": { |
| 143 | return `<h${html.level}>${content}</h${html.level}>` |
| 144 | } |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | const renderTreeSafe = ( |
| 149 | tree: DocTree.DocTree<SimpleHtml> |
no test coverage detected