///
// https://github.com/markitup/1.x/blob/master/markitup/sets/default/set.js
var mySettings = {
onShiftEnter: {
keepDefault: false,
replaceWith: '
\n'
},
onCtrlEnter: {
keepDefault: false,
openWith: '\n
',
closeWith: '
'
},
onTab: {
keepDefault: false,
replaceWith: ' '
},
markupSet: [
{
name: 'Bold',
key: 'B',
openWith: '(!(|!|)!)',
closeWith: '(!(|!|)!)'
},
{
name: 'Italic',
key: 'I',
openWith: '(!(|!|)!)',
closeWith: '(!(|!|)!)'
},
{
name: 'Stroke through',
key: 'S',
openWith: '',
closeWith: ''
},
{separator: '---------------'},
{
name: 'Bulleted List',
openWith: ' ',
closeWith: '',
multiline: true,
openBlockWith: ''
},
{
name: 'Numeric List',
openWith: ' ',
closeWith: '',
multiline: true,
openBlockWith: '\n',
closeBlockWith: '\n
'
},
{
separator: '---------------'
},
{
name: 'Picture',
key: 'P',
replaceWith: '
'
},
{
name: 'Link',
key: 'L',
openWith: '',
closeWith: '',
placeHolder: 'Your text to link...'
},
{
separator: '---------------'
},
{
name: 'Clean',
className: 'clean',
replaceWith: (markitup: MarkItUp.MarkupSet): string => {
return markitup.selection.replace(/<(.*?)>/g, "")
}
},
{
name: 'Preview',
className: 'preview',
call: 'preview'
}
]
};
// http://markitup.jaysalvat.com/documentation/
$('#markItUp').markItUp(mySettings);