FIX: Oneboxes were not being previewed
This commit is contained in:
parent
18d1ff0c0a
commit
657e592a39
|
@ -582,6 +582,7 @@ export default Ember.Component.extend({
|
||||||
let inline = {};
|
let inline = {};
|
||||||
$('a.inline-onebox-loading', $preview).each(function(index, link) {
|
$('a.inline-onebox-loading', $preview).each(function(index, link) {
|
||||||
let $link = $(link);
|
let $link = $(link);
|
||||||
|
$link.removeClass('inline-onebox-loading');
|
||||||
let text = $link.text();
|
let text = $link.text();
|
||||||
inline[text] = inline[text] || [];
|
inline[text] = inline[text] || [];
|
||||||
inline[text].push($link);
|
inline[text].push($link);
|
||||||
|
|
|
@ -7,6 +7,7 @@ function applyInlineOnebox(state, silent) {
|
||||||
|
|
||||||
for (let i=1; i<state.tokens.length; i++) {
|
for (let i=1; i<state.tokens.length; i++) {
|
||||||
let token = state.tokens[i];
|
let token = state.tokens[i];
|
||||||
|
|
||||||
if (token.type === "inline") {
|
if (token.type === "inline") {
|
||||||
let children = token.children;
|
let children = token.children;
|
||||||
for (let j=0; j<children.length-2; j++) {
|
for (let j=0; j<children.length-2; j++) {
|
||||||
|
@ -62,6 +63,6 @@ function applyInlineOnebox(state, silent) {
|
||||||
|
|
||||||
export function setup(helper) {
|
export function setup(helper) {
|
||||||
helper.registerPlugin(md => {
|
helper.registerPlugin(md => {
|
||||||
md.core.ruler.after('linkify', 'inline-onebox', applyInlineOnebox);
|
md.core.ruler.after('onebox', 'inline-onebox', applyInlineOnebox);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue