Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#8 | display-code-html-in-the-box-1934146-8.patch | 1.74 KB | Baher |
#3 | Screen Shot 2013-06-26 at 11.02.07 AM.png | 12.39 KB | Renee S |
#1 | form-textarea-to-paste-your-code-1934146-2.patch | 4.69 KB | flocondetoile |
#1 | syntaxhighlighter_insert_form.png | 14.39 KB | flocondetoile |
Comments
Comment #1
flocondetoilethis 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
Comment #2
Jelle_SFixed in latest dev version. Thank you for the patch!
Comment #3
Renee S CreditAttribution: Renee S commentedUnfortunately this inserts the text but without the tags.
Comment #4
flocondetoileHum.
I succeed to reproduce the bug. But after a clear cache, everything seems to be OK...
Have you tried to clear your cache ?
Comment #5
Renee S CreditAttribution: Renee S commentedYes, that's pretty much SOP with Drupal bugs ;) Didn't work, alas.
Comment #6
othermachines CreditAttribution: othermachines commentedThis is an issue for me, too. Typing the code directly into the box works fine, but pasting any plain text is problematic:
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).
Comment #7
Johann Wagner CreditAttribution: Johann Wagner commentedThank 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.
Comment #8
Baher CreditAttribution: Baher commentedHi,
I create this patch for the Syntaxhighlighter Insert dev version to resolve the problem of the Formatted html display. Please check
Baher