This may be a pipe dream, because I don't know if Kate's highlighting engine is capable of switching highlighting rules in the middle of a file, but it would be awesome if I could do ## Look some C++ ```cpp int main(int argc, char *argv[]) ``` ## And some Python ```python def hello(): print("Hello there") ``` when editing a Markdown file in Kate. Similar to what you can do at e.g. GitHub. This would mean 1) support for fenced code blocks, 2) support for switching to appropriate syntax highlighting rule within such blocks. Anyway, if it's completely out of the question, I rest my case. Thanks a lot for Kate! Reproducible: Always
I should add that, should Kate gain a live Markdown preview, which I've heard people ask for, then this wish could almost be thrown in the garbage, since I think it would then be easy to let that live preview be powered by a Markdown formatter that supports fenced code blocks.
Created attachment 107453 [details] A simple patch stub, with support for PHP and Python It is possible to switch syntax highlighting as it is done in the attached patch (hopefully without that much repeating). Another interesting solution: https://frinring.wordpress.com/2017/08/21/look-what-you-have-donewwdo/
Please upload patches to https://phabricator.kde.org/differential/diff/create/
*** Bug 389307 has been marked as a duplicate of this bug. ***
Relevant Phabricator Diff: https://phabricator.kde.org/D7864 (only PHP and Python supported).
Patch was merged, even more languages got added over the last year.