Opened 4 years ago

Closed 4 years ago

#14243 closed Bug (invalid)

img link in code tag gets interpreted, line breaks on adding new record and editing.

Reported by: Zenith Tekla Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:

Description

Steps to reproduce

Running ckEditor 5.4.3 on groceryCRUD, a CodeIgniter library.

  1. Adding new record/ Editing an existing one.
  2. Pasting code with CodeSnippet function works fine.
  3. However, on Click to edit the record (to add more content), code broken

Another way to reproduce error:

  1. Adding new record/ Editing an existing one.
  2. Inserting the <img src to the subject field does appear to give the same issue.

Expected result

  • No parsing of html codes inside the code & pre tags.
  • No line breaks.

Actual result

  • sample img link inside the code portion got interpreted
  • and line breaks appear in pre code portion.

Other details (browser, OS, CKEditor version, installed plugins)

I tried to configure my config.js https://github.com/zenithtekla/grocery_CRUD_codeigniter/blob/d35c34a6cfca7dbb7f8cf19d3e121ecc072843a0/assets/grocery_crud/texteditor/ckeditor/config.js#L11 but I encouter a few issues with my code (using codeSnippet) in code tag being interpreted. See photos https://drive.google.com/folderview?id=0B0qlwajiFDkBdTlld1R6Wm05UGc&usp=sharing Please help.

Link to test: https://grocery-crud-codeigniter-zenithtekla.c9users.io/index.php/Main/sample_table/read/163

Change History (6)

comment:1 Changed 4 years ago by Zenith Tekla

I meant ckEditor 4.5.3. Expected result:

  • No line breaks (no more automatic insertion of <br> and <p> tags into the code).
  • No processing of img src code
Last edited 4 years ago by Zenith Tekla (previous) (diff)

comment:2 Changed 4 years ago by Jakub Ś

Status: newpending
Version: 4.5.4

I have tried adding image code and other code to default CKEditor in code snippet plugin. Everything worked as expected.

I have then tried doing the same in your sample. Also the results were correct. Image code was not interpreted as image and adding more code didn't break existing one. Please see: https://grocery-crud-codeigniter-zenithtekla.c9users.io/index.php/Main/sample_table/edit/163.

Looking at the broken image - its URL is http:" + value.image + " this is definitely something non-standard and may be a reason why adding new code below image also breaks code snippet. It is very possible that this is implementation issue and may be caused by third-party plugin (you have few of them) or some core code modification in CKEditor.

How exactly are you inserting http:" + value.image + " into image dialog? Was it pasted like that manually or you have used image plugin to insert image?

comment:3 Changed 4 years ago by Zenith Tekla

Hello, Thank you for your reply. It's been awhile I know.

There is image insertion in my thread (163).

That's HTML code I grabed on StackOverflow and pasted directly into the code part.

My PHP site serves as a library for me to review things I have encountered or worked with in the past and my to-do learning/researching/referencing. Thanks, Zenith

Last edited 4 years ago by Zenith Tekla (previous) (diff)

comment:4 Changed 4 years ago by Jakub Ś

If I understand correctly this was a reason for your problems and this issue can be considered closed?

comment:5 Changed 4 years ago by Zenith Tekla

That's HTML code I grabed on StackOverflow and pasted directly into the code part.

and Nah, I haven't been able to fix it. Can you help? I try to find clues to which code part of the ckEditor (JS code) and groceryCRUD (codeIgniter PHP framework) I should inspect and fix.

The goal is to have ckEditor HTML-syntax display correctly after submission. In the database, everything is saved as the following:

...

$.ajax({

dataType: "json", url: URL, success: success

});

}

</code></pre>

<p><code class="language-javascript hljs"><img src="http:&quot; + value.image + &quot;" /></code></p> <code class="language-javascript hljs">"; result += "</code>

<p><code class="language-javascript hljs">" + value.phone + "</code></p> <code class="language-javascript hljs">"; result += value.body; result += "</code>

<div style=" border-bottom: 1px solid black;"> </div> <code class="language-javascript hljs">"; }); $(&#39;#result&#39;).html(result); ` </code>

comment:6 Changed 4 years ago by Jakub Ś

Component: Toolbar ConfiguratorGeneral
Resolution: invalid
Status: pendingclosed

and Nah, I haven't been able to fix it. Can you help?

Unfortunately not. This is a place for reporting CKEditor bugs. If you need help with your custom implementation, please ask your question on Stackoverflow - http://stackoverflow.com/questions/tagged/ckeditor.

NOTE: CKEditor has nothing to do with saving data. Please check what is the result of CKEditor getData(). If the code isn't chnaged, you need to look for the source of the problem in your server-side code.

I need to close the ticket.

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy