1

Topic: bbcode + html button problems

Hi,

I am currently working on adding custom bbcode to tinyMCE. I modified the bbcode->editor_plugin.js page to include the extra bbcodes I needed. Everything seems to work, the WYSIWYG is displaying correctly and when I go to HTML it converts the html to bbcode just fine but I run into a problem when I hit update within the html source editor popup window.

For some reason it keeps adding <p> around the bbcodes I added and every time you hit the update in the html editor it adds more. 

Here is a testing page I am working with - http://www.teammadness.net/bbtesting.php

bbcode js page (Made a comment above my changes)  - http://www.teammadness.net/assets/jscripts/tiny_mce/plugins/bbcode/editor_plugin.js


Thanks

2

Re: bbcode + html button problems

bump. Anyone?

3

Re: bbcode + html button problems

Try disabling p tags forced_root_blocks: false.

Best regards,
Spocke - Main developer of TinyMCE

4

Re: bbcode + html button problems

Well "forced_root_blocks: false" seems to have removed the blank <p></p> from the HTML view but the linebreaks are still showing in the WYSIWYG and keep growing when you go back and forth between HTML and the WYSIWYG.

I also tried  - force_br_newlines : false, force_p_newlines : false

5

Re: bbcode + html button problems

spocke wrote:

Try disabling p tags forced_root_blocks: false.

It's a "bug" in the bbcode plugin.

You should not be doing the <br /> to \n and \n to <br /> translations.

"Anything that is complex is not useful and anything that is useful is simple. This has been my whole life's motto." -- Mikhail T. Kalashnikov

6

Re: bbcode + html button problems

Krupski wrote:
spocke wrote:

Try disabling p tags forced_root_blocks: false.

It's a "bug" in the bbcode plugin.

You should not be doing the <br /> to \n and \n to <br /> translations.

That seems to have fixed the problem. Thanks

7

Re: bbcode + html button problems

last7studios wrote:

That seems to have fixed the problem. Thanks

Glad to help.

Remember if you update the editor when a new release comes out, you will have to re-edit the BBCode plugin.

Also, I really shouldn't have used the word "bug" because the BBCode plugin is written for the PUNBB message board. When used with other systems, some BBCodes may not be translated correctly (i.e. "\n" vs "<br />" may be a problem).

The BBCode plugin ideally should be customized to detect and translate the exact BBCodes and HTML that *your system* uses.

"Anything that is complex is not useful and anything that is useful is simple. This has been my whole life's motto." -- Mikhail T. Kalashnikov