Fix interstitial on localhost, distill-appendix crash on unpublished articles

This commit is contained in:
Ludwig Schubert
2017-10-19 13:44:56 -07:00
parent 02563c32d6
commit 1a4cd694cd
10 changed files with 134 additions and 83 deletions
-3
View File
@@ -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)) {
+10 -3
View File
@@ -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);
}
}
}
-1
View File
@@ -166,7 +166,6 @@ if (typeof window !== 'undefined') {
clearTimeout(timeout);
timeout = setTimeout(() => {
Figure.isScrolling = false;
console.log('Stopped Scrolling')
Figure.runReadyQueue();
}, 500);
};