mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-27 12:16:51 +00:00
Fixed link conversions to match parser
Change-Id: I67838a8c05729e4d32e6e2dfca53c7d457143ce3
This commit is contained in:
parent
20d1c290d4
commit
d61045085a
|
@ -24,7 +24,8 @@ ve.dm.LinkAnnotation.converters = {
|
|||
'toDomElement': function( subType, annotation ) {
|
||||
if ( annotation.type ) {
|
||||
var link = document.createElement( 'a' );
|
||||
link.setAttribute( 'data-type', 'link/' + subType );
|
||||
link.setAttribute( 'data-type', subType );
|
||||
link.setAttribute( 'href', annotation.data.href );
|
||||
return link;
|
||||
}
|
||||
},
|
||||
|
@ -32,7 +33,7 @@ ve.dm.LinkAnnotation.converters = {
|
|||
// FIXME: the parser currently doesn't output this data this way
|
||||
// Internal links get 'linkType': 'internal' in the data-mw-rt attrib, while external
|
||||
// links currently get nothing
|
||||
return { 'type': 'link/' + ( element.getAttribute( 'data-type' ) || 'unknown' ) };
|
||||
return { 'type': 'link/' + ( element.getAttribute( 'data-type' ) || 'unknown' ), 'data': { 'href': element.getAttribute( 'href' ) } };
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue