Step 1: Put this in a file named markdown_wrapper.py
in the project directory where you also find manage.py (Usually one level above the settings.py).
import markdown
class MyMarkdown(markdown2.Markdown):
def init(self, args, *kwargs):
extras = kwargs.get('extras', list())
extras.extend(['fenced-code-blocks'])
kwargs['extras'] = extras
super(MyMarkdown, self).__init__(*args, **kwargs)
Step 2: Add this line to the settings py:
ASKBOT_MARKDOWN_CLASS = 'markdown_wrapper.MyMarkdown'
Restart the server. The code highlighting should work now (not in editing mode, but you will see it after the question was published.)
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2023-04-06 23:13:58 +0000
Seen: 381 times
Last updated: Apr 07
How to reset the Askbot Database:
How can I enable pymemcach for the Askbot Django App?
How can I set up Gunicorn with a Django Project?
Looking for a Python Module that finds Tags for a Text describing its Content
Need a Function in Python to remove entries less than 2 digits from an Array
How can I convert a Document in Python?