'Adding markdown highlighted fenced block to django app with markdonx

I have been looking through the documentation but I can’t seem to get this to work. I wish to publish posts from a “creation page”. I want to use the editor markdownx. I got it to work, however there is no “fenced code support”. I tried to add the following line of code to my settings.py MARKDOWNX_MARKDOWN_EXTENSIONS = ['fenced_code'] but it breaks the code, in fact I get the following error (when I try to create a post): SyntaxError at /markdownx/markdownify/ if I erase the extensions list, it works fine. I would like also to use the codehilite extension by adding it to the list like this MARKDOWNX_MARKDOWN_EXTENSIONS = ['fenced_code' ,'codehilite'] but it does not work. I have installed pigments but the documentation does not seem to help. Could someone help me add this extensions correctly, getting highlighted code blocks to work. Thank you very much.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source