Cart Buy Licenses Contact Integrate into App Docs Support Login/Register
v 1.8.79
v 1.8.79
Overview Examples Docs Source

Markdown Radiogroup (Showdown)

Use markdown to render images in title and question elements


                var json = { questions: [
    "type": "radiogroup",
    "hasOther": true,
    "isRequired": true,
    "name": "favoritePet",
    "title": "What is your favorite pet ![A parrot]( =16x16) ?",
    "choices": [
        "value": "dog",
        "text": "Dog: ![A dog]( =14x14)"
        "value": "cat",
        "text": "Cat: ![A cat]( =14x14)"
        "value": "parrot",
        "text": "Parrot ![A parrot]( =14x14)"

                window.survey = new Survey.Model(json);
            survey.onComplete.add(function(sender) {
            document.querySelector('#surveyResult').textContent =
            "Result JSON:\n" + JSON.stringify(, null, 3);
//Create showdown markdown converter
var converter = new showdown.Converter();
survey.onTextMarkdown.add(function(survey, options){
    //convert the markdown text to html
    var str = converter.makeHtml(options.text);
    //remove root paragraphs <p></p>
    str = str.substring(3);
    str = str.substring(0, str.length - 4);
    //set html
    options.html = str;
            var app = new Vue({
            el: '#surveyElement',
            survey: survey

<!DOCTYPE html>
<html lang="en">
    <title>Use markdown to render images in title and question elements, Vue Survey Library Example</title>

<meta name="viewport" content="width=device-width" />
    <script src=""></script>
    <script src="/DevBuilds/survey-vue/survey.vue.min.js"></script>
    <link href="/DevBuilds/survey-core/modern.min.css" type="text/css" rel="stylesheet" />
    <link rel="stylesheet" href="./index.css">
<script src=""></script>
            <div id="surveyElement" style="display:inline-block;width:100%;">
                <survey :survey='survey' />
    <div id="surveyResult"></div>

<script type="text/javascript" src="./index.js"></script>


SurveyJS supports markdown via onTextMarkDown event. You may use any JavaScript markdown library. In this example, we are using Showdown markdown. You may use all features that this or other libraries have.