Hello,
how can I extend the BBcode string in the BBcode plugin? I need an Image and a List with BBcode. It's cool that you put this function to the plugins. I still wrote some little Code in the bbcode/fckplugin.js, but it don't want be the right result:
Has somebody an extended FCKBBCode plugin?
Can you Help me?
how can I extend the BBcode string in the BBcode plugin? I need an Image and a List with BBcode. It's cool that you put this function to the plugins. I still wrote some little Code in the bbcode/fckplugin.js, but it don't want be the right result:
data = data.replace( /\[IMG\](.+?)\[\/IMG]\[ALT\](.+?)\[\/ALT\]/gi, '<img src="$2" alt="$3" width="$1" border="0" />' ) ;
Has somebody an extended FCKBBCode plugin?
Can you Help me?
Re: BBCode extension
Hello again,
here is my complete editor/plugin/bbcode/fckplugin.js . I had put the standart BBCodes, which works with a BBcode parser, into the file. But it want work right. It only shows the b/i/u and the url strings right. Where is the problem? Do I have to modify another file?
Re: BBCode extension
Hi,
Converting from BBCodes to HTML using regular expressions is possible and you can do it in the way you do it now.
However the opposite is not possible (in more complicated examples).
We have wrote recently one plugin that may help you in writing your BBcode plugin.
It is MediaWiki extension: http://mediawiki.fckeditor.net/.
It does not parse BBCodes, but it converts HTML to different syntax, so generally it does exactly what your plugin.
Locate fckplugin.js file: mediawiki\extensions\FCKeditor\plugins\mediawiki\fckplugin.js and take a look in it.
ConvertToDataFormat is the function you should look at. We use there _AppendNode method, which traverse through HTML DOM and appends wiki tags to stringbuilder.
You should try to copy that function (along with _AppendNode, _AppendChildNodes) and adjust it to your needs.
I know it may look scary so if you have questions feel free to ask.
Wiktor Walc
CTO, CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+