summaryrefslogtreecommitdiff
path: root/yaksh/views.py
diff options
context:
space:
mode:
authoradityacp2020-08-27 17:25:36 +0530
committeradityacp2020-08-27 17:25:36 +0530
commitde9ac5e647622f0e9908bf830a4a962306d350a1 (patch)
tree500472264e312f7c39ce46b80272cac9f58db2e7 /yaksh/views.py
parent632b906a8f0bf038b61783588fcd4423a6df8a09 (diff)
downloadonline_test-de9ac5e647622f0e9908bf830a4a962306d350a1.tar.gz
online_test-de9ac5e647622f0e9908bf830a4a962306d350a1.tar.bz2
online_test-de9ac5e647622f0e9908bf830a4a962306d350a1.zip
Add mathjax support in lesson and module
Diffstat (limited to 'yaksh/views.py')
-rw-r--r--yaksh/views.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/yaksh/views.py b/yaksh/views.py
index 3adb536..15ebd03 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -3,7 +3,7 @@ import csv
from django.http import HttpResponse, JsonResponse, HttpResponseRedirect
from django.contrib.auth import login, logout, authenticate
from django.shortcuts import render, get_object_or_404, redirect
-from django.template import Context, Template
+from django.template import Context, Template, loader
from django.http import Http404
from django.db.models import Max, Q, F
from django.db import models
@@ -23,7 +23,7 @@ from django.urls import reverse
import json
from textwrap import dedent
import zipfile
-from markdown import Markdown
+import markdown
try:
from StringIO import StringIO as string_io
except ImportError:
@@ -101,7 +101,9 @@ CSV_FIELDS = ['name', 'username', 'roll_number', 'institute', 'department',
def get_html_text(md_text):
"""Takes markdown text and converts it to html"""
- return Markdown().convert(md_text)
+ return markdown.markdown(
+ md_text, extensions=['tables', 'fenced_code']
+ )
def formfield_callback(field):