function convertText(node, context, txt, normalizeWhitespaces) {
    function jsonText(text) {
        return JSON.stringify(normalizeWhitespaces ? normalizeHtmlWhitespace(text) : text)
    }
    let res = ''
    let first = true
    const concatChar = node.type === 'text' ? ',' : '+'
    while (_.includes(txt, '{')) {
        const start = txt.indexOf('{')
        const pre = txt.substr(0, start)
        if (pre) {
            res += (first ? '' : concatChar) + jsonText(pre)
            first = false
        }
        let curlyCounter = 1
        let end = start
        while (++end < txt.length && curlyCounter > 0) {
            curlyCounter += curlyMap[txt.charAt(end)] || 0
        }
        if (curlyCounter === 0) {
            const needsParens = start !== 0 || end !== txt.length - 1
            res += (first ? '' : concatChar) + (needsParens ? '(' : '') + txt.substr(start + 1, end - start - 2) + (needsParens ? ')' : '')
            first = false
            txt = txt.substr(end)
        } else {
            throw RTCodeError.build(context, node, `Failed to parse text '${txt}'`)
        }
    }
    if (txt) {
        res += (first ? '' : concatChar) + jsonText(txt)
    }
    if (res === '') {
        res = 'true'
    }
    return res
}
@param node
@param {Context} context
@param {string} txt
@param {boolean} [normalizeWhitespaces]
@return {string}