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.
Problem/Motivation
The ckeditor CodeSnippet plugin forces code blocks (doesn't allow simple inline code
tags.
Adding simple code
tags in the content requires editing the source.
The CKEditor Code tag plugin alleviates this by providing a simple button to wrap text in code
tags.
Proposed resolution
Add support for the ckeditor Code tag plugin. Though perhaps not within the original scope of this module, it seems fitting to add Code tag as another way of marking up code, and a separate module is unnecessary.
User interface changes
Would make a new editor button available on the text formats configuration pages.
Comment | File | Size | Author |
---|---|---|---|
#12 | error.png | 27.85 KB | kevinquillen |
#3 | 2765899-code-tag-plugin-0.patch | 3.67 KB | kentr |
Comments
Comment #2
kentr CreditAttribution: kentr as a volunteer commentedComment #3
kentr CreditAttribution: kentr as a volunteer commentedComment #4
kentr CreditAttribution: kentr as a volunteer commentedComment #5
kevinquillen CreditAttribution: kevinquillen at Velir commentedComment #7
kevinquillen CreditAttribution: kevinquillen at Velir commentedI think it should be its own module.. that way people who just want inline code don't need the rest of it, and vice versa. But since it has 0 configuration, it is fairly innocuous and can be included here for the time being.
Comment #8
kevinquillen CreditAttribution: kevinquillen at Velir commentedTested, and working. A follow up issue will be posted about amending the install file.
Comment #9
kevinquillen CreditAttribution: kevinquillen at Velir commentedComment #10
kevinquillen CreditAttribution: kevinquillen at Velir commentedComment #11
kevinquillen CreditAttribution: kevinquillen at Velir commentedThis now creates a concrete dependency on both plugins, because enabling CodeSnippet triggers the code tag plugin as well, and without the JS files, the format page can break.
Even though it is very small, I think it is best to encapsulate it to it's own module.
Comment #12
kevinquillen CreditAttribution: kevinquillen at Velir commentedAttaching pic of error if code tag was not downloaded.
Comment #13
kevinquillen CreditAttribution: kevinquillen at Velir commentedOk, I just extracted and created it as a separate module as to not burden people who just want one and not the other. I can make you a maintainer if you like.
https://www.drupal.org/project/codetag
Comment #14
kentr CreditAttribution: kentr as a volunteer commentedOh... It didn't occur to me that Drupal would try to load the js. That's in the editor admin page, right?
Sure, I'll be a maintainer of the other one.
Comment #15
kevinquillen CreditAttribution: kevinquillen at Velir commentedAdded you to CodeTag.