Skip to content

Commit

Permalink
Merge pull request #472 from mitre-attack/471-add-hover-information-t…
Browse files Browse the repository at this point in the history
…o-references

add reference title to marker
  • Loading branch information
jondricek authored Nov 28, 2023
2 parents 6e1c079 + bf99f7b commit 6eee043
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions custom_jinja_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"<span onclick=scrollToRef('scite-{}') "
'id="scite-ref-{}-a" class="scite'
'-citeref-number" '
'title="{}"'
'data-reference="{}"><sup><a href="{}" '
'target="_blank" data-hasqtip="{}" '
'aria-describedby="qtip-{}">[{}]</a></sup></span>'
Expand All @@ -20,7 +21,8 @@
"<span onclick=scrollToRef('scite-{}') "
'id="scite-ref-{}-a" '
'class="scite-citeref-number" '
'data-reference="{}">'
'data-reference="{}"'
'title="{}">'
"<sup>[{}]</sup></span>"
)

Expand Down Expand Up @@ -89,7 +91,8 @@ def get_html_citation(citations, citation_name):
reference_html = ""
if citation:
ref_number = None

description = citation.get("description")

if citation.get("number"):
ref_number = citation["number"]
else:
Expand All @@ -98,10 +101,10 @@ def get_html_citation(citations, citation_name):
citation["number"] = ref_number

if not citation.get("url"):
reference_html = reference_marker_template_no_url.format(ref_number, ref_number, citation_name, ref_number)
reference_html = reference_marker_template_no_url.format(ref_number, ref_number, citation_name, description, ref_number)
else:
reference_html = reference_marker_template.format(
ref_number, ref_number, citation_name, citation["url"], ref_number - 1, ref_number - 1, ref_number
ref_number, ref_number, description, citation_name, citation["url"], ref_number - 1, ref_number - 1, ref_number
)

return reference_html
Expand Down

0 comments on commit 6eee043

Please sign in to comment.