# HG changeset patch # User gibus # Date 1311600950 -7200 # Node ID e4a0c2fe8df2e382dadf74e1c23313946675ea4a # Parent 98af3be91847821e5879216a1882917fc7719db1 markdown2pdf is buggy => convert to HTML and use abiword to export in PDF diff -r 98af3be91847 -r e4a0c2fe8df2 src/cm/views/export.py --- a/src/cm/views/export.py Thu Jul 21 15:03:38 2011 +0200 +++ b/src/cm/views/export.py Mon Jul 25 15:35:50 2011 +0200 @@ -31,6 +31,15 @@ export_content = content else: if use_pandoc : + # markdown2pdf is buggy => convert to HTML and use abiword to export in PDF + if format == 'pdf' and USE_ABI: + html_content = pandoc_convert(content, content_format, 'html', full=True) + from cm.converters.abi_converters import AbiFileConverter + converter = AbiFileConverter() + full_content = converter.add_html_header(html_content) + fix_content = do_tidy(full_content) + export_content = converter.convert_from_html(fix_content, format) + else: export_content = pandoc_convert(content, content_format, format, full=True) else : fix_content = content