FIX: Oneboxes were not being previewed

This commit is contained in:
Robin Ward 2017-07-20 17:12:26 -04:00
parent 18d1ff0c0a
commit 657e592a39
2 changed files with 3 additions and 1 deletions

View File

@ -582,6 +582,7 @@ export default Ember.Component.extend({
let inline = {};
$('a.inline-onebox-loading', $preview).each(function(index, link) {
let $link = $(link);
$link.removeClass('inline-onebox-loading');
let text = $link.text();
inline[text] = inline[text] || [];
inline[text].push($link);

View File

@ -7,6 +7,7 @@ function applyInlineOnebox(state, silent) {
for (let i=1; i<state.tokens.length; i++) {
let token = state.tokens[i];
if (token.type === "inline") {
let children = token.children;
for (let j=0; j<children.length-2; j++) {
@ -62,6 +63,6 @@ function applyInlineOnebox(state, silent) {
export function setup(helper) {
helper.registerPlugin(md => {
md.core.ruler.after('linkify', 'inline-onebox', applyInlineOnebox);
md.core.ruler.after('onebox', 'inline-onebox', applyInlineOnebox);
});
}