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 = {};
|
||||
$('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);
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue