Hello,

How do you paste your code into the block created, instead of Type your code in the box. To create a new line within the box use SHIFT + ENTER. ?

If i paste some code (plain text) inside the block, the markup

 is  broken.
I have to switch to view the source code, and then i can paste the code.

Comments

flocondetoile’s picture

Title: paste your code in the block » textarea in the form to paste your code directly
Status: Active » Needs review
FileSize
14.39 KB
4.69 KB

this patch add a textarea in the form (load from the wysiwyg) where you can paste your code and then insert it directly in the node's body.

The screenshot show the new form

Jelle_S’s picture

Version: 7.x-1.1 » 7.x-1.x-dev
Status: Needs review » Fixed

Fixed in latest dev version. Thank you for the patch!

Renee S’s picture

Status: Fixed » Needs work
FileSize
12.39 KB

Unfortunately this inserts the text but without the tags.

flocondetoile’s picture

Hum.
I succeed to reproduce the bug. But after a clear cache, everything seems to be OK...
Have you tried to clear your cache ?

Renee S’s picture

Yes, that's pretty much SOP with Drupal bugs ;) Didn't work, alas.

othermachines’s picture

This is an issue for me, too. Typing the code directly into the box works fine, but pasting any plain text is problematic:

  • Pasting in the code and hitting SAVE results in the code being formatted outside the inserted tags.
  • Pasting in the code and pressing ENTER will not take you outside of the box, as is the usual behaviour. The cursor seems "stuck" inside the box.
  • Typing in two lines of code, pasting a block of code in between these two lines, then hitting SAVE, results in only the first line of code being output between the tags.

I've tried with PHP, CSS, and JScript brushes. Pasting from Notepad++ and Windows Notepad. I re-sorted the other filters, turned them on and off one by one, and finally turned them all off (with the awareness that this was a long shot, since these should only affect the text on the front end).

It seems that this doesn't happen for everyone. Whoever wrote this tutorial recommended pasting directly inside the box, so clearly they weren't having this issue. I'm assuming most people are using (as I am) <= Wysiwyg 7.x-2.2, which doesn't yet support CKeditor 4.x. It would be worth testing with Wysiwyg 7.x-2.x-dev (requires a db update) and CKeditor 4+, but I'm not convinced it will help.

Having said all that, installing Syntaxhighlighter Insert 7.x-1.x-dev and using the "Code to insert" field allows me to paste in code. It would be nice to be able to paste directly, but this will do for now (thx @flocondetoile).

Johann Wagner’s picture

Issue summary: View changes

Thank you, the patch works with CKEditor 4.

The only thing I noticed, is that when using the button to insert, the textarea "Code to insert" is on a newline whereas when using the link under the wysiwyg window, the same teaxtarea appears on the right of the syntax options, making the horizontal scrollbar visible.

Baher’s picture

Hi,

I create this patch for the Syntaxhighlighter Insert dev version to resolve the problem of the Formatted html display. Please check

Baher