Hey Sahil,
If I understand correctly, you want the MathJax output to appear correctly
to the user on the page (e.g. so that it is copy-pastable into a LaTeX
document)? Django has 'filters' to control if/how the content is escaped in
the template. For instance, you might have '{{ my_variable|safe }}' to tell
Django not to escape/sanitize the output in any way, or '{{ my_variable |
escape }}' to tell Django to HTML-escape (e.g. & becomes &) the
variable.
David
On Friday, February 14, 2014 4:20:30 PM UTC-7, SAHIL SHEKHAWAT wrote:
>
> please help me out!
> i am passing mathjax generated from result set of sympy_gamma as json to
> template of django which include escape sequences and i want python( or
> django) to interpret it but json.dumps return a string so it is getting
> passed as it is. ( e.g. double backslash instead of single one)
> If passed as variable it is rendered correctly but as json it doesn't.
> have two ways but they are not very efficient and i have doubts with both.
> 1) replace the double backslash with single. ( but '\n' can also come and
> its is not predictable but all cases can be included and
> my_string.replace('\\\\','\\') is not working)
> 2) passing the values as variables and then after rendering adding them as
> strings.( but we want double quotes instead of single so have to dump to
> json in JS somehow)
> thanks
>
>
>
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
For more options, visit https://groups.google.com/groups/opt_out.