mirror of
https://github.com/wassname/template.git
synced 2026-07-11 07:13:54 +08:00
Fix interstitial on localhost, distill-appendix crash on unpublished articles
This commit is contained in:
@@ -14,9 +14,6 @@ export class Article extends HTMLElement {
|
||||
for (const mutation of mutations) {
|
||||
for (const addedNode of mutation.addedNodes) {
|
||||
switch (addedNode.nodeName) {
|
||||
// case 'HR':
|
||||
// console.warn('Use of <hr> tags in distill articles is discouraged as they interfere with layout! To separate sections, please just use h2 or h3 tags.');
|
||||
// break;
|
||||
case '#text': { // usually text nodes are only linebreaks.
|
||||
const text = addedNode.nodeValue;
|
||||
if (!isOnlyWhitespace.test(text)) {
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
import { parseBibtex } from '../helpers/bibtex';
|
||||
|
||||
export function parseBibliography(element) {
|
||||
if (element.firstElementChild && element.firstElementChild.tagName === 'SCRIPT') {
|
||||
const bibtex = element.firstElementChild.textContent;
|
||||
return parseBibtex(bibtex);
|
||||
const scriptTag = element.firstElementChild;
|
||||
if (scriptTag && scriptTag.tagName === 'SCRIPT') {
|
||||
if (scriptTag.type == 'text/bibtex') {
|
||||
const bibtex = element.firstElementChild.textContent;
|
||||
return parseBibtex(bibtex);
|
||||
} else if (scriptTag.type == 'text/json') {
|
||||
return new Map(JSON.parse(scriptTag.textContent));
|
||||
} else {
|
||||
console.warn('Unsupported bibliography script tag type: ' + scriptTag.type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -166,7 +166,6 @@ if (typeof window !== 'undefined') {
|
||||
clearTimeout(timeout);
|
||||
timeout = setTimeout(() => {
|
||||
Figure.isScrolling = false;
|
||||
console.log('Stopped Scrolling')
|
||||
Figure.runReadyQueue();
|
||||
}, 500);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user