diff --git a/abcfield.py b/abcfield.py index 05d8c94..cb3db54 100755 --- a/abcfield.py +++ b/abcfield.py @@ -181,7 +181,12 @@ def expandCustomMarkdown(t, dir, latex): fname = m.group(1) + ".abc" path = pathlib.Path(dir, fname) with path.open() as f: - return "[" + getFieldDisplayText(f, dir, "T", latex) + "](" + fname + ")" + title = getFieldDisplayText(f, dir, "T", latex=latex) + f.seek(0) + subtitle = getFieldDisplayText(f, dir, "T", n=2, latex=latex) + if len(subtitle) > 0: + title = title + " (" + subtitle + ")" + return "[" + title + "](" + fname + ")" return re.sub(r'<(.*?).abc>', getTitle, t) # Return the raw text for a given field. Optionally the nth field is taken,