From e15fab2d7563c8fd3ae650c0f8b00cfda9b63752 Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Mon, 25 Jul 2016 17:30:03 +0530 Subject: - Fix syntax highlighting for c, java, shell and scilab - Add social-auth to setup.py --- setup.py | 3 ++- yaksh/templates/yaksh/question.html | 12 +++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 6bc0168..0c0b7f9 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,8 @@ setup( 'django==1.9.5', 'mysql-python==1.2.5', 'django-taggit==0.18.1', - 'pytz==2016.4' + 'pytz==2016.4', + 'python-social-auth==0.2.19' ], classifiers=[ 'Development Status :: 4 - Beta', diff --git a/yaksh/templates/yaksh/question.html b/yaksh/templates/yaksh/question.html index 54fb30b..40d4482 100644 --- a/yaksh/templates/yaksh/question.html +++ b/yaksh/templates/yaksh/question.html @@ -224,9 +224,19 @@ function call_skip(url) // Get the textarea node var textarea_node = document.querySelector('#answer'); + var lang = "{{ question.language }}" + var mode_dict = { + 'python': 'python', + 'c': 'text/x-csrc', + 'cpp': 'text/x-c++src', + 'java': 'text/x-java', + 'bash': 'text/x-sh', + 'scilab': 'text/x-csrc' + } + // Code mirror Options var options = { - mode: "{{ question.language }}", + mode: mode_dict[lang], gutter: true, lineNumbers: true, -- cgit