SCEditor
SCEditor copied to clipboard
Adding bbcode support to format plugin
I wanted to do it, but I don't know how a tagname variable can be converted to property name:
+ tags: {
+ h1: null
+ },
var obj = {
tags: {}
},
isInline: false,
allowedChildren: ['#'],
format: '[h' + num + ']{0}[/h' + num + ']',
html: '<h' + num + '>{0}</h' + num + '>'
}
obj['tags']['h' + num] = null
return obj
^inside a function (not tested)
Updated. thanks. That's one of the reasons I don't like JS... Too many ways to get to the same thing.