diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2019-04-11 18:44:21 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2019-04-11 18:44:21 +0200 |
| commit | 9b1e2709cbdb40eabb34d379df18e61c10e3737c (patch) | |
| tree | b04bae90e465ad524441bc745f9b849a245287e4 /megapixels | |
| parent | 3dedfa97961c1c4569ee30fc9dc039ee46f8b19d (diff) | |
add h3
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>' |
