Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Luuuk Posted February 21, 2019 Posted February 21, 2019 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. Armbian_Werner, Dan Korn and Interferon 2 1
Luuuk Posted April 10, 2019 Author Posted April 10, 2019 (edited) Is there a non-invasive way to modify the settings? Edited April 20, 2019 by Luuuk
opmows Posted April 26, 2019 Posted April 26, 2019 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. Luuuk 1
Luuuk Posted July 8, 2019 Author Posted July 8, 2019 Not to be pushy, but... Is there any chance to have the option in the stock?
Luuuk Posted June 5, 2021 Author Posted June 5, 2021 (edited) So... after two years no input? Nobody has the same issue as me? Edited June 5, 2021 by Luuuk
SeNioR- Posted June 6, 2021 Posted June 6, 2021 (edited) 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, 2021 by SeNioR- Luuuk 1
Nathan Explosion Posted June 6, 2021 Posted June 6, 2021 (edited) 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, 2021 by Nathan Explosion Threw a plugin together SeNioR- and Luuuk 2
Luuuk Posted June 6, 2021 Author Posted June 6, 2021 @Nathan Explosion Thanks so much for all the effort! Yeah, I want to use "No Syntax Highlighting" as the default setting.
cfish Posted May 28, 2023 Posted May 28, 2023 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.
Nathan Explosion Posted May 28, 2023 Posted May 28, 2023 (edited) 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, 2023 by Nathan Explosion Luuuk and SeNioR- 2
Recommended Posts