Closed (fixed)
Project:
WYSIWYG Code Button
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
13 May 2011 at 18:33 UTC
Updated:
24 Oct 2011 at 15:50 UTC
Jump to comment: Most recent file
Comments
Comment #1
geerlingguy commented...or, better yet, add two buttons: one for code, and one for pre...? User can enable whichever one he likes.
Comment #2
rkodrupal commentedthe pre tag has been available in wysiwyg for ages ... using the style drop down menu ... only code is needed.
Comment #3
David_Rothstein commented@rkodrupal, the style dropdown is really only appropriate for administrators, right? (Since it provides many options, some of which assume you have access to
<h1>and other tags, and as far as I know there's no way to customize which options appear).The use case here is more for a low-level site user who needs to be able to paste code samples into their posts.
Comment #4
rkodrupal commentedgood point. i keep forgetting about those pesky users.
k
Comment #5
greg.1.anderson commentedSwitching to
codewill fix #1156926: Unclicking the code button doesn't work, so I think this is probably the way to go. I think I would be satisfied ifcodemode made the unmodified [return] key work like [shift]+[return], and insert a br rather than making a new paragraph. Of course, you couldn't use the Code Filter module if yourcodetags had escaped HTML inside; then you'd get double-escaped text, which would not render correctly. Maybe the HTML inside thecodetags could be unescaped on save, and re-escaped on load, so that the editor behaved correctly while editing, and the code filter could do its job at display time? Or maybe the ckeditor code plugin should use neither code nor pre, but have a third, new tag that is used?I'm not completely sure. Mostly, what I want is a button that works right for dropping in code in wysiwyg mode, but it would also be a good nice-to-have if it would interoperate with plaintext editing.
Comment #6
David_Rothstein commentedAlex Bronstein actually wrote some code a little while ago (but did not post it here) that allows the administrator to choose between
<pre>and<code>tags.I need to carve out some time soon to review/commit some of the other patches that are now in the issue queue (thanks by the way!), then dig up Alex's code and see if it still works then :) Hopefully it will.
Comment #7
pwolanin commentedHere's Alex's changes extracted.
Comment #8
pwolanin commentedComment #9
pwolanin commentedoops - forgot the patch
Comment #10
pwolanin commentedcommitted