Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted February 21, 20195 yr Hi, Please consider adding a simple admin option to choose the default Code syntax highlighting. HTML being preselected just doesn't fit to many communities and it is so unhandy to select manually something different each time the Code is inserted. Also, users are submitting content fast without even bothering to change the syntax from the menu and I have a lot of work to edit their posts. Related topics here and here.
April 10, 20195 yr Author Is there a non-invasive way to modify the settings? Edited April 20, 20195 yr by Luuuk
April 26, 20195 yr It is annoying indeed. For years I am asking for a Lisp code syntax highlighting and never got any replay of any kind, not even HOWTO info.
June 5, 20213 yr Author So... after two years no input? Nobody has the same issue as me? Edited June 5, 20213 yr by Luuuk
June 6, 20213 yr It seems to me that it is not so easy to add this option to ACP because it is a CKEditor plugin. If you want to change the default code syntax highlighting, try going to applications\core\interface\ckeditor\ckeditor\plugins\ipscode\plugin.js Open plugin.js find \x26lang\x3dhtml and change the \x26lang\x3dhtml suffix to css or lua or something else. e.g. \x26lang\x3dcss \x26lang\x3dpython I have not tested this method, so I do not guarantee that it will work. Edited June 6, 20213 yr by SeNioR-
June 6, 20213 yr Edit the following template: core -> global -> editor -> code At the very start of the template, place one of the following depending on your desired default entry: {{$language = 'null';}} {{$language = 'html';}} {{$language = 'css';}} {{$language = 'javascript';}} {{$language = 'php';}} {{$language = 'sql';}} {{$language = 'xml';}} null = 'No Syntax Highlighting' Want to use one of the other entries as the default? I reckon you're going to have to get busy with some Javascript, and I'm not going there. Note: this might result in existing codeboxes defaulting back to your chosen language instead of the actual language that is in the existing code...not tested that. EDIT: or you could use the attached plugin 😉 plugin has one caveat to be aware of and that is noted in the settings. (NE) Change 'Code' default language.xml Edited June 6, 20213 yr by Nathan Explosion Threw a plugin together
June 6, 20213 yr Author @Nathan Explosion Thanks so much for all the effort! Yeah, I want to use "No Syntax Highlighting" as the default setting.
May 28, 20231 yr Did anyone ever find a solution to this problem? I've been trying for years to find a way of adding a LISP code mode to the editor for syntax highlighting and getting no help as to how I might even begin such a thing. Assuming that is impossible, the option to change the default from HTML to no highlighting would at least be a step in the right direction.
May 28, 20231 yr This post was recognized by Marc! Nathan Explosion was awarded the badge 'Helpful' and 5 points. 25 minutes ago, cfish said: Did anyone ever find a solution to this problem? Well, yes...it is posted a few posts up, and the plugin that was made for those that don't want to edit the template has since been added to this: Edited May 28, 20231 yr by Nathan Explosion