mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 06:46:26 +00:00
Added rendering for link/unknown
Change-Id: I47cdc8679c533f15059b290bf30ae74518dce724
This commit is contained in:
parent
773be35b16
commit
402d6dc53a
|
@ -103,6 +103,13 @@ ve.ce.TextNode.annotationRenderers = {
|
||||||
return '<span class="ve-ce-content-format-link" data-title="wiki/' + data.title + '">';
|
return '<span class="ve-ce-content-format-link" data-title="wiki/' + data.title + '">';
|
||||||
},
|
},
|
||||||
'close': '</span>'
|
'close': '</span>'
|
||||||
|
},
|
||||||
|
'link/unknown': {
|
||||||
|
'open': function( data ) {
|
||||||
|
if ( !data) { debugger; }
|
||||||
|
return '<span class="ve-ce-content-format-link" data-href="' + data.href + '">';
|
||||||
|
},
|
||||||
|
'close': '</span>'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -154,6 +161,9 @@ ve.ce.TextNode.prototype.getHtml = function() {
|
||||||
|
|
||||||
for ( var hash in annotations ) {
|
for ( var hash in annotations ) {
|
||||||
annotation = annotations[hash];
|
annotation = annotations[hash];
|
||||||
|
if ( renderers[annotation.type] === undefined ) {
|
||||||
|
debugger;
|
||||||
|
}
|
||||||
out += typeof renderers[annotation.type].open === 'function' ?
|
out += typeof renderers[annotation.type].open === 'function' ?
|
||||||
renderers[annotation.type].open( annotation.data ) :
|
renderers[annotation.type].open( annotation.data ) :
|
||||||
renderers[annotation.type].open;
|
renderers[annotation.type].open;
|
||||||
|
|
Loading…
Reference in a new issue