SCEditor icon indicating copy to clipboard operation
SCEditor copied to clipboard

Adding bbcode support to format plugin

Open abetis opened this issue 6 years ago • 3 comments

abetis avatar Apr 10 '18 10:04 abetis

I wanted to do it, but I don't know how a tagname variable can be converted to property name:

+					tags: {
+						h1: null
+					},

abetis avatar Apr 10 '18 12:04 abetis

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)

brunoais avatar Apr 10 '18 15:04 brunoais

Updated. thanks. That's one of the reasons I don't like JS... Too many ways to get to the same thing.

abetis avatar Apr 10 '18 17:04 abetis