#4969 closed Bug (invalid)
Quote char changed inside PRE tag
| Reported by: | Tobiasz Cudnik | Owned by: | |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | General | Version: | SVN (CKEditor) - OLD |
| Keywords: | Pending | Cc: |
Description
Quote char is changed inside PRE tag.
Reproduce
- Switch to source view
- Replace editor with following content
<pre>'</pre>
- Switch to wysiwyg view and back to the source view
- Result:
<pre> '</pre>
Reproduced using r4896 on Chrome.
Change History (5)
comment:1 Changed 16 years ago by
| Keywords: | Pending added |
|---|
comment:2 Changed 16 years ago by
| Resolution: | → invalid |
|---|---|
| Status: | new → closed |
It's not wrong to have entities inside <pre>. Single quotes are replaced by default everywhere in the contents.
If you want to avoid it, simply set the entities_additional to your needs.
comment:3 Changed 16 years ago by
| Resolution: | invalid |
|---|---|
| Status: | closed → reopened |
I am afraid, this is not the solution. If you change the quotes to the html-code, the html-code will be shown instead of the quotes, which is not what the author desires.
Quotes are not the only problem. For instance, a small listing of C source code is mashed up by ckeditor completely. Copy and paste the following lines into the demo application and open the resulting html code directly in a browser (not only in the ckeditor window).
<pre>
#include <sys/time.h>
#include <stdio.h>
#include <stdint.h>
static uint64_t now()
{
/* time value container */
struct timeval tv;
/* get unix time */
gettimeofday( &tv, NULL );
/* return double value of unix time */
return (tv.tv_sec * 1000000) + tv.tv_usec;
}
</pre>
To my humble opionion, text inside pre-tags must never be changed by the editor. The above quotes are just the tip of the problem.
comment:4 Changed 16 years ago by
| Milestone: | CKEditor 3.x |
|---|---|
| Resolution: | → invalid |
| Status: | reopened → closed |
The contents of <pre> must be valid, and you'll need to escape them. Check that fragment with http://validator.w3.org/#validate_by_input+with_options
If you enter the data in design mode and set the pre format to it, it will generate the correct code:
<pre>
#include <sys/time.h>
#include <stdio.h>
#include <stdint.h>
static uint64_t now()
{
/* time value container */
struct timeval tv;
/* get unix time */
gettimeofday( &tv, NULL );
/* return double value of unix time */
return (tv.tv_sec * 1000000) + tv.tv_usec;
}
</pre>}}}
comment:5 Changed 16 years ago by
Ok, I see. I tested on and it seems to be caused by Geshi, which requires plain code (non-html) listings. For now I can work with FCKeditor and the GeshiPro plugin. Maybe I should write a tutorial on that one, as some drupal friends have the same problem...
Thanks so far :) nesono

All quotes are changed in the editor, being there inside <pre> or not. What's the problem with it?