Skip to content

Commit

Permalink
add a fix for image captions with https
Browse files Browse the repository at this point in the history
  • Loading branch information
dansand committed May 17, 2024
1 parent fedf056 commit e4cbf92
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/scripts/parse_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,16 @@ def parse_image_and_caption(img_string, default_filename):

md_regex = r"\[(?P<filename>.*?)\]\((?P<url>.*?)\)"
html_regex = r'alt="(?P<filename>[^"]+)" src="(?P<url>[^"]+)"'
pattern = re.compile(r"https://github.com/ModelAtlasofTheEarth/[^/]+/assets/")

# Hack to recognise SVG files
filetype.add_type(Svg())

caption = []

for string in img_string.split("\r\n"):
if "https://github.com/ModelAtlasofTheEarth/model_submission/assets/" in string:
#if "https://github.com/ModelAtlasofTheEarth/model_submission/assets/" in string:
if pattern.search(string):
try:
image_record = re.search(md_regex, string).groupdict()
except:
Expand Down

0 comments on commit e4cbf92

Please sign in to comment.