diff --git a/scripts/blurb.py b/scripts/blurb.py index ac18536..97b0bf9 100644 --- a/scripts/blurb.py +++ b/scripts/blurb.py @@ -51,7 +51,7 @@ def split_blurb(lines): """ Split blurb on horizontal rules.""" blurbs = [""] for line in lines.split('\n')[:-1]: - if re.match(r'\*\*\*\**',line): + if re.match(r'\*{3,}',line): blurbs.append("") else: blurbs[-1] += line + '\n' diff --git a/scripts/gallery.py b/scripts/gallery.py index 18a3253..812f774 100755 --- a/scripts/gallery.py +++ b/scripts/gallery.py @@ -52,7 +52,7 @@ def gallery(force): if os.path.isfile(document): with open(document, 'rt') as readme: for line in readme.readlines(): - match = re.match(r"^.*!(\[.*\]\(.*\)).*$", line) + match = re.search(r"!(\[.*\]\(.*\))", line) if match: image = match.group(0) if image.startswith('![Main Assembly](assemblies/'): diff --git a/scripts/views.py b/scripts/views.py index 7391296..f5dee74 100755 --- a/scripts/views.py +++ b/scripts/views.py @@ -227,11 +227,7 @@ def views(target, do_assemblies = None): # # Only add the image if the first blurb section doesn't contain one. # - got_image = False - for line in blurbs[0].split('\n'): - if re.match(r'.*\!\[.*\]\(.*\).*', line): - got_image = True - if not got_image: + if not re.search(r'\!\[.*\]\(.*\)', blurbs[0], re.MULTILINE): print('![Main Assembly](assemblies/%s.png)\n' % flat_bom[-1]["name"].replace('_assembly', '_assembled'), file = doc_file) eop(print_mode, doc_file, first = True) #