test handling alt from post request

This commit is contained in:
James Ravenscroft 2024-12-02 13:57:42 +00:00
parent d1e0106373
commit 01ff701fef
1 changed files with 6 additions and 1 deletions

View File

@ -344,7 +344,12 @@ def process_multipart_post():
if "thumbnail" not in frontmatter: if "thumbnail" not in frontmatter:
frontmatter["thumbnail"] = photo_url frontmatter["thumbnail"] = photo_url
frontmatter["photo"].append(photo_url) if "mp-photo-alt[]" in request.form:
alt = request.form["mp-photo-alt[]"][i]
else:
alt = ""
frontmatter["photo"].append({"value": photo_url, "alt": alt})
# docstr += f'\n\n<img src="{photo_url}" class="u-photo" />' # docstr += f'\n\n<img src="{photo_url}" class="u-photo" />'