( node: GroupNode, settings: HTMLSettings, )
| 445 | }; |
| 446 | |
| 447 | const htmlGroup = async ( |
| 448 | node: GroupNode, |
| 449 | settings: HTMLSettings, |
| 450 | ): Promise<string> => { |
| 451 | // ignore the view when size is zero or less |
| 452 | // while technically it shouldn't get less than 0, due to rounding errors, |
| 453 | // it can get to values like: -0.000004196293048153166 |
| 454 | // also ignore if there are no children inside, which makes no sense |
| 455 | if (node.width < 0 || node.height <= 0 || node.children.length === 0) { |
| 456 | return ""; |
| 457 | } |
| 458 | |
| 459 | // this needs to be called after CustomNode because widthHeight depends on it |
| 460 | const builder = new HtmlDefaultBuilder(node, settings).commonPositionStyles(); |
| 461 | |
| 462 | if (builder.styles) { |
| 463 | const attr = builder.build(); |
| 464 | const generator = await htmlWidgetGenerator(node.children, settings); |
| 465 | return `\n<div${attr}>${indentString(generator)}\n</div>`; |
| 466 | } |
| 467 | return await htmlWidgetGenerator(node.children, settings); |
| 468 | }; |
| 469 | |
| 470 | // For htmlText and htmlContainer, use the htmlGenerationMode to determine styling approach |
| 471 | const htmlText = (node: TextNode, settings: HTMLSettings): string => { |
no test coverage detected