FIX: inline oneboxer min title length of 2

also: cache mini onebox misses as well to cut down traffic
This commit is contained in:
Sam
2018-01-30 08:39:41 +11:00
parent d37477b1ef
commit f946db4afe
5 changed files with 33 additions and 5 deletions

View File

@@ -96,15 +96,15 @@ function applyOnebox(state, silent) {
if (!isTopLevel(href)) {
let onebox = cachedInlineOnebox(href);
let options = state.md.options.discourse;
if (options.lookupInlineOnebox) {
onebox = options.lookupInlineOnebox(href);
}
if (onebox) {
if (onebox && onebox.title) {
text.content = onebox.title;
} else if (state.md.options.discourse.previewing) {
} else if (state.md.options.discourse.previewing && !onebox) {
attrs.push(["class", "inline-onebox-loading"]);
}
}