mirror of
https://0xacab.org/anarsec/anarsec.guide.git
synced 2025-06-07 22:32:55 -04:00
fix typst images
This commit is contained in:
parent
5d9796b043
commit
d10f774921
4 changed files with 9 additions and 2 deletions
|
@ -127,6 +127,10 @@ class Converter:
|
|||
recommendations = re.search(r'\+{3}.*?\+{3}(.*)', recommendations_file.open().read(), re.MULTILINE | re.DOTALL).group(1)
|
||||
markdown_content += f"\n\n# Recommendations\n\n{recommendations}\n\n"
|
||||
|
||||
# Make all images paths relative in the Markdown content
|
||||
for extension in ["jpg", "png", "webp", "jpeg"]:
|
||||
markdown_content = re.sub(f'\\(\\/posts/{input_path.parent.name}/(.*?\.{extension})\\)', lambda match: f'({match.group(1)})', markdown_content)
|
||||
|
||||
# Replace all .webp images to .png images in the Markdown content
|
||||
markdown_content = re.sub(r'\((.*?\.webp)\)', lambda match: f'({match.group(1)}.png)', markdown_content)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue