diff --git a/src/wikimore/app.py b/src/wikimore/app.py index 73b17b7..45388b5 100644 --- a/src/wikimore/app.py +++ b/src/wikimore/app.py @@ -336,6 +336,11 @@ def wiki_article( if any(cls in li.get("class", []) for cls in ["nv-view", "nv-talk", "nv-edit"]): li.decompose() + for span in soup.find_all(class_="mw-reflink-text"): + parent = span.parent + if parent.attrs.get("data-mw-group", None): + span["class"] = span.get("class", []) + [parent.attrs["data-mw-group"]] + processed_html = str(body) rtl = bool(soup.find("div", class_="mw-parser-output", dir="rtl")) diff --git a/src/wikimore/static/css/style.css b/src/wikimore/static/css/style.css index b3a5626..5e1a3c5 100644 --- a/src/wikimore/static/css/style.css +++ b/src/wikimore/static/css/style.css @@ -919,6 +919,40 @@ Currently blocked by implementation of comments retrieval in the backend } */ +/* Footnote weirdness */ +.mw-reflink-text.lower-alpha::before { + content: "[" counter(mw-Ref, lower-alpha) "]"; +} + +.mw-reflink-text.upper-alpha::before { + display: inline; + content: "[" counter(mw-Ref, upper-alpha) "]"; +} + +.mw-reflink-text.lower-roman::before { + content: "[" counter(mw-Ref, lower-roman) "]"; +} + +.mw-reflink-text.upper-roman::before { + content: "[" counter(mw-Ref, upper-roman) "]"; +} + +.mw-reflink-text.decimal::before { + content: "[" counter(mw-Ref, decimal) "]";; +} + +.mw-reflink-text::before { + font-size: 1rem; +} + +.mw-reflink-text.lower-alpha, +.mw-reflink-text.upper-alpha, +.mw-reflink-text.lower-roman, +.mw-reflink-text.upper-roman, +.mw-reflink-text.decimal { + font-size: 0; +} + /* Media query for devices with a max width of 768px */ @media (max-width: 768px) { #header {