(dialogNode, context)
| 14 | * @returns {HTMLElement|undefined} The processed element. |
| 15 | */ |
| 16 | export function processText (dialogNode, context) { |
| 17 | let text = utils.i18n(dialogNode, 'text') |
| 18 | try { |
| 19 | text = tmpl(text || '', context) |
| 20 | } catch (err) { |
| 21 | console.warn("Couldn't process text template:", err, { dialogNode, text, context }) |
| 22 | } |
| 23 | if (!text) { |
| 24 | return undefined |
| 25 | } |
| 26 | |
| 27 | const newText = decodeHtml(marked(text)) |
| 28 | return wrapText(`<div>${newText}</div>`) |
| 29 | } |
| 30 | |
| 31 | /** |
| 32 | * Converts a string such as "3 < 2" into "3 < 2". |
no test coverage detected