Skip to content

Latest commit

 

History

History
48 lines (46 loc) · 1.29 KB

README.md

File metadata and controls

48 lines (46 loc) · 1.29 KB

SimpleMDE - Markdown Editor (With Mentions)

Based on sparksuite/simplemde-markdown-editor

var md = new SimpleMDE(
{ 
    element: document.getElementById("MyID"),
    autoSuggest: 
    {
        mode: 'markdown',
        triggers: {
            '@': function(stringToTest) {
                return [
                    {
                        text: 'Thomas ',
                        displayText: 'Thomas'
                    },
                    {
                        text: 'Maria ',
                        displayText: 'Maria'
                    },
                    {
                        text: 'Peter ',
                        displayText: 'Peter'
                    }
                ];
            },
            '#': function(stringToTest) {
                return [
                    {
                        text: 'Two Sum ',
                        displayText: 'Two Sum'
                    },
                    {
                        text: '3Sum ',
                        displayText: '3Sum'
                    },
                    {
                        text: '4Sum ',
                        displayText: '4Sum'
                    }
                ];
            }
        },
    },
});