Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#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

  1. Switch to source view
  2. Replace editor with following content
    <pre>'</pre>
    
  3. Switch to wysiwyg view and back to the source view
  4. Result:
    <pre>
    &#39;</pre>
    

Reproduced using r4896 on Chrome.

Change History (5)

comment:1 Changed 14 years ago by Frederico Caldeira Knabben

Keywords: Pending added

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

comment:2 Changed 14 years ago by Frederico Caldeira Knabben

Resolution: invalid
Status: newclosed

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 14 years ago by nesono

Resolution: invalid
Status: closedreopened

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 14 years ago by Alfonso Martínez de Lizarrondo

Milestone: CKEditor 3.x
Resolution: invalid
Status: reopenedclosed

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 &lt;sys/time.h&gt;
#include &lt;stdio.h&gt;
#include &lt;stdint.h&gt;

static uint64_t now()
{
  /* time value container */
  struct timeval tv;
  /* get unix time */
  gettimeofday( &amp;tv, NULL );
  /* return double value of unix time */
  return (tv.tv_sec * 1000000) + tv.tv_usec;
}

</pre>}}}

comment:5 Changed 14 years ago by nesono

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

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy