Explorar el Código

Corrected documentation, and also fixed bug where using unicode strings would not get recognized (thanks to TheNeuralBit)

Barry Steyn hace 10 años
padre
commit
85a51f6b81
Se han modificado 2 ficheros con 5 adiciones y 5 borrados
  1. 2 2
      render_math/Readme.md
  2. 3 3
      render_math/math.py

+ 2 - 2
render_math/Readme.md

@@ -37,7 +37,7 @@ the plugin and start writing your Math.
 
 ### Settings
 Certain MathJax rendering options can be set. These options 
-are in a dictionary variable called `MATH` in the pelican
+are in a dictionary variable called `MATH_JAX` in the pelican
 settings file.
 
 The dictionary can be set with the following keys:
@@ -58,7 +58,7 @@ rendering LaTex. If set to `Tex`, then the TeX code is used as the preview
 For example, in settings.py, the following would make math render in blue and
 displaymath align to the left:
 
-    MATH = {'color':'blue','align':left}
+    MATH_JAX = {'color':'blue','align':left}
 
 #### Resulting HTML
 Inlined math is wrapped in `span` tags, while displayed math is wrapped in `div` tags.

+ 3 - 3
render_math/math.py

@@ -68,7 +68,7 @@ def process_settings(pelicanobj):
     for key, value in ((key, settings[key]) for key in settings):
         # Iterate over dictionary in a way that is compatible with both version 2
         # and 3 of python
-        if key == 'align' and isinstance(value, str):
+        if key == 'align' and isinstance(value, basestring):
             if value == 'left' or value == 'right' or value == 'center':
                 mathjax_settings[key] = value
             else:
@@ -83,10 +83,10 @@ def process_settings(pelicanobj):
         if key == 'process_escapes' and isinstance(value, bool):
             mathjax_settings[key] = 'true' if value else 'false'
 
-        if key == 'latex_preview' and isinstance(value, str):
+        if key == 'latex_preview' and isinstance(value, basestring):
             mathjax_settings[key] = value
 
-        if key == 'color' and isinstance(value, str):
+        if key == 'color' and isinstance(value, basestring):
             mathjax_settings[key] = value
 
     return mathjax_settings