Hello,
BUEditor with a BBCode filter is exactly what we need for our site, and I thought it was working, however I found a pretty big problem: If you submit while in preview mode, the filter is ignored. Steps to reproduce:
1) Enter "I am [b]bold[/b]"
2) Click preview - the preview looks fine, bold is applied
3) Then click submit
4) The post will become: "I am bold"
I repeat this same process without step 2 and it works fine. So something in the preview button is causing it to revert to HTML and ignore the underlying filter (in this case BBCode).
I am using the BBCode filter provided here: http://drupal.org/project/bbcode
I am using BUEditor with the BBCode buttons provided here: http://drupal.org/node/163034
The source of the preview button is attached.
Any ideas would be greatly appreciated. Thanks.
| Comment | File | Size | Author |
|---|---|---|---|
| preview_button.txt | 3.21 KB | luxx |
Comments
Comment #1
luxx commentedTo be clear, step #4 is using the < b > bold tags which are HTML
Comment #2
luxx commentedMy first thought to fix this was to do a form alter:
When the form is submitted, do a form alter: if preview is currently turned on enabled, if it is, call function eDefPreview(NoAutoP, selOnly) in bueditor\library\default_buttons_functions.js to turn off preview, otherwise do nothing.
Only problem is knowing when it is pressed, which will require another js function, which unfortunately I have no idea how to write js.
Comment #3
ufku commentedThis is because the bbcode text is converted to html while previewing.
Adding
E.setContent(E.oriCnt);aftereDefPreview();may help.Comment #4
luxx commentedWorked perfectly. Thanks!
Comment #5
luxx commented