Lack of interest Make code blocks more extensible

This suggestion has been closed automatically because it did not receive enough votes over an extended period of time. If you wish to see this, please search for an open suggestion and, if you don't find any, post a new one.

md_5

Well-known member
I am using the excellent Geshi highlighter by @digitalpoint, however many users are unaware that they can actually use Java and YAML syntax highlights. The solution to this is of course to add these to the dropdown menu by editing the template, simple enough.
However then we run into this code in bb_code_edit.js:
Code:
            switch ($('#redactor_code_type').val())
            {
                case 'html': tag = 'HTML'; break;
                case 'php':  tag = 'PHP'; break;
                default:     tag = 'CODE';
            }
Quite simply, this prevents us from adding new code types without editing core javascript files by hand.
A more appropriate method would be:
Code:
tag = $('#redactor_code_type').val().toUpperCase()

Thanks
 
Upvote 0
This suggestion has been closed. Votes are no longer accepted.
I ended up breaking down and the new version of my syntax highlighter overwrites the insertCode JavaScript method so you can add languages to the editor's code dialog (and they will work... which is the important part).

It adds JavaScript and CSS by default, but adding any language that GeSHi supports to the template would work.
 
I ended up breaking down and the new version of my syntax highlighter overwrites the insertCode JavaScript method so you can add languages to the editor's code dialog (and they will work... which is the important part).

It adds JavaScript and CSS by default, but adding any language that GeSHi supports to the template would work.
I like to add C++ to the list, which template should I edit? tks
 
Top Bottom