Move collect_citations to helper file

This commit is contained in:
Ludwig Schubert
2017-10-10 12:40:07 -07:00
parent 0ab27e1382
commit fe7b4748fc
4 changed files with 17 additions and 17 deletions
-12
View File
@@ -61,18 +61,6 @@ figcaption .citation-number {
</span>
`);
export function collectCitations(dom=document) {
const citations = new Set();
const citeTags = dom.querySelectorAll('d-cite');
for (const tag of citeTags) {
const keys = tag.getAttribute('key').split(',');
for (const key of keys) {
citations.add(key);
}
}
return [...citations];
}
export class Cite extends T(HTMLElement) {
/* Lifecycle */