Support passing MIMETypes and actual document filenames to TextParser for better lexer guessing

This commit is contained in:
Roberto Rosario
2012-08-06 03:00:09 -04:00
parent 27c0a3ef43
commit 576a2cc643
3 changed files with 39 additions and 15 deletions

View File

@@ -184,7 +184,7 @@ class TextParser(Parser):
parser = OriginalTextParser()
document_page.content = '\n'.join(parser.render_to_viewport(filename=document_file)[int(pagenum) - 1])
document_page.content = '\n'.join(parser.render_to_viewport(filename=document_file, mimetype=document_page.document_version.mimetype)[int(pagenum) - 1])
document_page.page_label = _(u'Text extracted from file')
document_page.save()