( descriptionId: string, step: Step )
| 4 | import './shepherd-text.css'; |
| 5 | |
| 6 | export function createShepherdText( |
| 7 | descriptionId: string, |
| 8 | step: Step |
| 9 | ): HTMLDivElement { |
| 10 | const el = h('div', { |
| 11 | class: 'shepherd-text', |
| 12 | id: descriptionId |
| 13 | }) as HTMLDivElement; |
| 14 | |
| 15 | let text = step.options.text; |
| 16 | |
| 17 | if (isFunction(text)) { |
| 18 | text = text.call(step); |
| 19 | } |
| 20 | |
| 21 | if (isHTMLElement(text)) { |
| 22 | el.appendChild(text); |
| 23 | } else { |
| 24 | el.innerHTML = text as string; |
| 25 | } |
| 26 | |
| 27 | return el; |
| 28 | } |
no test coverage detected