MCPcopy
hub / github.com/Effect-TS/effect / encloseInTag

Function encloseInTag

packages/printer/test/docTree.test.ts:128–146  ·  view source on GitHub ↗
(content: string, html: SimpleHtml)

Source from the content-addressed store, hash-verified

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>

Callers 1

renderTreeSafeFunction · 0.85

Calls 1

colorToHexFunction · 0.85

Tested by

no test coverage detected