Hi
I am trying to get the Mivhak syntax highlighter to work with DWQA Pro.
If you do not know Mivhak syntax highlighter, then have a look here: https://wordpress.org/plugins/mivhak/
It is a brilliant, fast and lightweight syntax highlighter for code entered in the TinyMCE editor, but I believe I need to be able to load some scripts when the editor is loaded in DWQA, and before the buttons/styles are loaded to the editor.
But there are not really any hooks in the Editor.php file to load additional TinyMCE scripts when the DWQA editor is loaded.
So I would like to know if you could consider a hook to load additional scripts for the DWQA Pro editor, so third party extensions to TinyMCE can be loaded on DWQA pages?
I prefer to only load the scripts when needed and not in init, so that is why I am suggesting that you create some hooks for this in editor.php
You should really take a look at Mivhak, it is a great addon for code styling in TinyMCE.
Hi,
You can use the code below to add Mivhak to DW Q&A Editor.
add_filter( 'dwqa_tinymce_toolbar1', 'add_more_button_field' ); function add_more_button_field( $text ) { return 'bold,italic,underline,|,' . 'bullist,numlist,blockquote,|,' . 'link,unlink,|,' . 'image,code,|,'. 'spellchecker,fullscreen,dwqaCodeEmbed,mivhak_button,|,'; } add_filter( 'mce_external_plugins', 'add_more_button_script' ); function add_more_button_script( $plugin_array ) { $plugin_array['mivhak_button'] = Mivhak\JS_URL.'/editor.js'; return $plugin_array; } add_action( 'wp_enqueue_scripts', 'enqueue_script' ); function enqueue_script() { wp_enqueue_script( 'amarkan-script', Mivhak\PLUGIN_URL . '/vendor/askupa-software/amarkal-framework/Assets/js/amarkal.min.js', array(), true ); } add_filter( 'dwqa_filter_kses', 'add_allow_kses' ); function add_allow_kses( $kses ) { $kses['pre'] = array( 'class' => array() ); return $kses; }
Thanks, I will test this, and get back to you.
I apears to be working.. Great.
You’re welcome. 🙂 Should you need any further assistance, please let us know. We’ll be happy to help.
Well actually yes.
If I were to load some editor styling so the code blocks, can be shown more visually with a different font or in a box with a frame, in the editor, which hook can I use to load additional Editor styling?
Right now you can’t tell the difference between normal text and the code inserted via mivhak.
Please login or Register to submit your answer