mirror of
https://github.com/wassname/template.git
synced 2026-10-02 12:50:05 +08:00
Move collect_citations to helper file
This commit is contained in:
1 parent
0ab27e1382
commit
fe7b4748fc
4 files changed
+17
-17
No files matched your search
@@ -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 */
|
||||
|
||||
Reference in new issue
Block a user