Jump to:
| Project: | Wysiwyg |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (won't fix) |
Issue Summary
Hi,
I have installed wysiwyg 6.x.-1.x-dev + TinyMCE 2.1.3 on my Drupal 6.3.
I have created only one profile for wysiwyg.
The principal settings of this profile are:
Roles allowed to use this profile: all
Verify HTML: false
Preformatted: true
Convert font tags to styles: true
Remove linebreaks: false
Apply source formatting: false
I have disabled the html filter & corrector of Drupal.
Any time that I insert the tag CODE, it disappears! But html verify is disabled!
Any time that I insert the tag PRE with a proper formatting, this one disappears next time I open the document or it modified by the addition of BR tag (that I don't want!)
But, have profile settings any sense?
Is it possible to disable such verify phase?
I need to insert piece of source code in my documents and I have some trouble with this setting!
Comments
#1
After other 3 hours... I discovered the problem!
It is a tinyMCE bug!
Description of problem:
I want to insert some Java code using tag.
It is important that breaklines and spaces are preserved as in the source.
Even if the remove_breaklines option is disabled and source formatting is
enabled, the tag is malformed:
INPUT:
<pre>
row1
row2
</pre>
OUTPUT (after save) is
<pre>
row1
row2
</pre>
If you disabled source formating function, the result is
<pre> row1<br /> row2<br /></pre>
Tags <br /> are not desirable!!!
I have read in the forum that a solution is to add a custom cleanup
function that remove <br />, but even this solution is not good because
the result would be:
<pre> row1 row2</pre>
because tinyMCE.formatHTML() changes anytime!
I believe that the instruction at line 5049 of file tiny_mce.js
h = h.replace(new RegExp('\\n\\s+', 'gi'), '\n'); // Remove previous
formatting
remove too much spaces (surely when these are inside an tag!)
I removed this instruction and now I have tags well formatted and
without any unwanted
tags.
In this way, I can use other plugings to colorize the java code inside
;-)
#2
Great that you found a solution yourself for a bug that cannot be fixed in a Drupal module. You should definitely file an issue in TinyMCE's/moxiecode's bugtracker/forum.