I'm trying the example to add headers as custom commands and bbcode but this one doesn't work for bbcode, the content displayed is the good level header but the content is always "0" when I change WYSIWYG to source or source to WYSIWYG, no diference:
sceditor.formats.bbcode.set("h2", { tags: { h2: null }, format: "[h2]{0}[/h2]", html: "<h2>{0}</h2>", isInline: false });
But with this it work perfectly:
`sceditor.formats.bbcode.set('h2', { tags: { h2: null }, format: function (elm, content) { return '[h2]' + content + '[/h2]'; }, html: function (token, attrs, content) { return '
' + content + '
'; }, isInline: false });
Firefox 124.0.1, Windows 11 up to date, SCEditor 3.2.0. Not tested on an other configuration.
I answer to myself, this is caused by my use of smarty templates during my tests so in this case the { and }, in this particular context, should be escaped.
I'm trying the example to add headers as custom commands and bbcode but this one doesn't work for bbcode, the content displayed is the good level header but the content is always "0" when I change WYSIWYG to source or source to WYSIWYG, no diference:
sceditor.formats.bbcode.set("h2", { tags: { h2: null }, format: "[h2]{0}[/h2]", html: "<h2>{0}</h2>", isInline: false });
But with this it work perfectly: `sceditor.formats.bbcode.set('h2', { tags: { h2: null }, format: function (elm, content) { return '[h2]' + content + '[/h2]'; }, html: function (token, attrs, content) { return '
' + content + '
'; }, isInline: false });Firefox 124.0.1, Windows 11 up to date, SCEditor 3.2.0. Not tested on an other configuration.
Configuration of SCEditor option is:
Steps to reproduce the problem