diff options
| author | adamhrv <adam@ahprojects.com> | 2019-04-12 09:10:21 +0200 |
|---|---|---|
| committer | adamhrv <adam@ahprojects.com> | 2019-04-12 09:10:21 +0200 |
| commit | 1e98a1f926475d03077a7d18d3557140e83d41ba (patch) | |
| tree | 55c42f5320f0ef9472fc5b92844e7bb2109374a9 /megapixels | |
| parent | 57fba037d519e45488599288f7753cb7a3cd32aa (diff) | |
| parent | 9b1e2709cbdb40eabb34d379df18e61c10e3737c (diff) | |
ugh, merge
Diffstat (limited to 'megapixels')
| -rw-r--r-- | megapixels/app/site/parser.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/megapixels/app/site/parser.py b/megapixels/app/site/parser.py index dc2a09f2..6b71e041 100644 --- a/megapixels/app/site/parser.py +++ b/megapixels/app/site/parser.py @@ -145,8 +145,11 @@ def parse_markdown(metadata, sections, s3_path, skip_h1=False): return '<a class="footnote_shim" name="{}_{}"> </a><a href="#{}" class="footnote" title="Footnote {}">{}</a>'.format(key, footnote_count, key, index, index) key_regex = re.compile(key.replace('[', '\\[').replace('^', '\\^').replace(']', '\\]')) content = key_regex.sub(footnote_tag, content) - footnote_txt = footnote_txt.replace("{}_BACKLINKS".format(index), "".join(footnote_backlinks)) + footnote_txt = footnote_txt.replace("{}_BACKLINKS".format(key), "".join(footnote_backlinks)) + content += '<section>' + content += '<h3>References</h3>' content += footnote_txt + content += '</section>' return content @@ -254,7 +257,7 @@ def format_footnotes(footnotes, s3_path): continue key, note = footnote.split(': ', 1) footnote_index_lookup[key] = index - footnote_list.append('<a name="{}" class="footnote_shim"></a><span class="backlinks">{}_BACKLINKS</span>'.format(key, index) + markdown(note)) + footnote_list.append('<a name="{}" class="footnote_shim"></a><span class="backlinks">{}_BACKLINKS</span>'.format(key, key) + markdown(note)) index += 1 footnote_txt = '<section><ul class="footnotes"><li>' + '</li><li>'.join(footnote_list) + '</li></ul></section>' |
