add latex conversion (with pandoc)
authorraph
Mon, 25 Jan 2010 09:23:32 +0100
changeset 118 75d94dd14511
parent 117 17a9fbf356a9
child 119 5e8dda1b7631
add latex conversion (with pandoc)
src/cm/converters/__init__.py
--- a/src/cm/converters/__init__.py	Fri Jan 22 14:15:46 2010 +0100
+++ b/src/cm/converters/__init__.py	Mon Jan 25 09:23:32 2010 +0100
@@ -35,10 +35,13 @@
         converted_input = pandoc_convert(xhtml_input, 'html', format)
         
     ##############################
+    # latex
+    elif mime_type in ['application/x-latex','text/x-tex',]:
+        converted_input = pandoc_convert(to_unicode(input), 'latex', format)
+    
+    ##############################
     # anything looks like code: put them into markdown citation
-    elif mime_type.startswith('text/x-') or mime_type in ['application/x-latex',
-                                                          'application/x-ruby',
-                       ]:
+    elif mime_type.startswith('text/x-') or mime_type in ['application/x-ruby',]:
         converted_input = markdown_from_code(input)
 
     ##############################