@@ -35,18 +35,9 @@ def convert(problem: str, options: argparse.Namespace) -> bool:
35
35
statement_common .foreach_image (statement_path ,
36
36
lambda img_name : copy_image (problem , img_name ))
37
37
38
- with open (statement_path , "r" ) as source :
39
- statement_md = source .read ()
40
- # Replace \nextsample with \\nextsample to avoid pandoc interpreting it as a newline
41
- statement_md = statement_md .replace ('\\ nextsample' , '\\ \\ nextsample' )
42
- statement_md = statement_md .replace ('\\ remainingsamples' , '\\ \\ remainingsamples' )
43
- with tempfile .NamedTemporaryFile (mode = 'w' , suffix = ".md" ) as temp_file :
44
- temp_file .write (statement_md )
45
- temp_file .flush ()
46
-
47
- command = ["pandoc" , temp_file .name , "-t" , "html" , "-f" , "markdown-raw_html" , "--mathjax" ]
48
- statement_html = subprocess .run (command , capture_output = True , text = True ,
49
- shell = False , check = True ).stdout
38
+ command = ["pandoc" , statement_path , "-t" , "html" , "-f" , "markdown-raw_html" , "--mathjax" ]
39
+ statement_html = subprocess .run (command , capture_output = True , text = True ,
40
+ shell = False , check = True ).stdout
50
41
51
42
52
43
templatepaths = [os .path .join (os .path .dirname (__file__ ), 'templates/markdown_html' ),
@@ -69,7 +60,7 @@ def convert(problem: str, options: argparse.Namespace) -> bool:
69
60
70
61
samples = statement_common .format_samples (problem , to_pdf = False )
71
62
72
- # Insert samples at \ nextsample and \ remainingsamples
63
+ # Insert samples at {{ nextsample}} and {{ remainingsamples}}
73
64
html_template , remaining_samples = statement_common .inject_samples (html_template , samples , "" )
74
65
75
66
# Insert the remaining samples at the bottom
0 commit comments