change html % bug

This commit is contained in:
Siwat Sirichai 2024-05-19 12:24:57 +07:00
parent aff49fe67a
commit 83f67fe399
10 changed files with 720 additions and 718 deletions

View file

@ -17,13 +17,17 @@ for html_file in html_files:
html_content = f.read()
# Close the html file
f.close()
# Section Disabled, Using client side JS to replace variables
# First, replace % with %%
html_content = html_content.replace("%", "%%")
#html_content = html_content.replace("%", "%%")
# The html file contains placeholders for the variables
# These placeholders are in the form of $(variable_name)$
# Replace these with %variable_name%
html_content = re.sub(r"\$\((.*?)\)\$", r"%\1%", html_content)
#html_content = re.sub(r"\$\((.*?)\)\$", r"%\1%", html_content)
# Create the temp folder if it doesn't exist
if not os.path.exists("temp"):
os.makedirs("temp")
# Save the new content to a new file in the temp directory