Add markdown property to skill-choice


#1

Hello Community,

is there a way to add

markdown: true

to the “question” text of the skill-choice renderer without loosing functionality?


#2

I don’tthink it’s supported. But you may try to customize skill-choice for your needs.


#3

Adding this to the src/renderers.js seems to work:

    'builtin_single-choice': data => {
        const SKIP_CHOICE_PREFIX = /^!skip |^!hide |^!hidden /i;
        const takeVisible = choices => {
            return (choices || []).filter(c => !SKIP_CHOICE_PREFIX.test(c.value) && !SKIP_CHOICE_PREFIX.test(c.title));
        };
        return {
            on: 'webchat',
            text: data.text,
            markdown: true,
            quick_replies: takeVisible(data.choices).map(c => `<${c.value}> ${c.title}`),
            typing: data.typing
        }
    },