Liam Dyer commited on
Commit
7ca6619
1 Parent(s): 4013f70

fix: pandoc

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -60,7 +60,11 @@ def extract_metadata_from_pdf(reader):
60
  def convert_pandoc(input_file):
61
  # Convert the file to markdown with pandoc
62
  output_file = f"{random_word(16)}.md"
63
- result = subprocess.call(f"pandoc {input_file} -t markdown -o {output_file}")
 
 
 
 
64
 
65
  # Read the file and delete
66
  with open(output_file, "r") as f:
 
60
  def convert_pandoc(input_file):
61
  # Convert the file to markdown with pandoc
62
  output_file = f"{random_word(16)}.md"
63
+ result = subprocess.call(
64
+ ["pandoc", input_file, "-t", "markdown", "-o", output_file]
65
+ )
66
+ if result != 0:
67
+ raise ValueError("Error converting file to markdown with pandoc")
68
 
69
  # Read the file and delete
70
  with open(output_file, "r") as f: