link to pythonanywhere

This commit is contained in:
mdipierro
2013-10-30 08:59:55 -05:00
parent c89ed53be1
commit 1474a4fe79
3 changed files with 6 additions and 5 deletions
+4 -3
View File
@@ -4,6 +4,7 @@
# recreated by Vladyslav Kozlovskyy
# license MIT/BSD/GPL
import re
import urllib
from cgi import escape
from string import maketrans
try:
@@ -466,7 +467,7 @@ You can use Google charts to render the formula:
``
LATEX = '<img src="http://chart.apis.google.com/chart?cht=tx&chl=%s" />'
markmin2html(text,{'latex':lambda code: LATEX % code.replace('"','\\\\"')})
markmin2html(text,{'latex':lambda code: LATEX % urllib.quote(code)})
``
### Code with syntax highlighting
@@ -779,7 +780,7 @@ def render(text,
'xaaax'
>>> print render(r"$$\int_a^b sin(x)dx$$")
<img src="http://chart.apis.google.com/chart?cht=tx&chl=\\int_a^b sin(x)dx" />
<img src="http://chart.apis.google.com/chart?cht=tx&chl=%5Cint_a%5Eb%20sin%28x%29dx" />
>>> markmin2html(r"use backslash: \[\[[[mess\[[ag\]]e link]]\]]")
'<p>use backslash: [[<a href="link">mess[[ag]]e</a>]]</p>'
@@ -1382,7 +1383,7 @@ def render(text,
% (id_prefix+d,b,d) \
for d in escape(code).split(','))+']'
elif b=='latex':
return LATEX % code.replace('"','\"').replace('\n',' ')
return LATEX % urllib.quote(code)
elif b in html_colors:
return '<span style="color: %s">%s</span>' \
% (b, render(code, {}, {}, 'br', URL, environment, latex,