Skip to content

Commit

Permalink
Interpret LaTex math inside tables
Browse files Browse the repository at this point in the history
We have to:

 - Re-enable the extension that parses markdown inside raw html.
 - Flatten the tables, so they are processed as html instead of code
   (see jgm/pandoc#1841).
  • Loading branch information
Zaharid committed Feb 1, 2017
1 parent a631329 commit 6420ce2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/reportengine/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def report(template, report_style, output_path,
'-o', str(pandoc_path),
'-s' ,'-S' ,'--toc',
#http://stackoverflow.com/questions/39220389/embed-indented-html-in-markdown-with-pandoc
'-f', 'markdown-markdown_in_html_blocks+raw_html',
'-f', 'markdown+raw_html',
'--to', 'html5',
'--css', report_style]
if pandoc_template:
Expand Down
3 changes: 3 additions & 0 deletions src/reportengine/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
@author: Zahari Kassabov
"""
import logging
import re

#TODO: Get rid of explicit pandas dependency here?
import pandas as pd
Expand Down Expand Up @@ -46,6 +47,8 @@ def _constructor(self):
def as_markdown(self):
with pd.option_context('display.max_colwidth', -1):
res = self.to_html(escape = False, border=0)
#See https://github.com/jgm/pandoc/issues/1841
res = re.sub('\n\s+', '\n', res)
return res


Expand Down

0 comments on commit 6420ce2

Please sign in to comment.