mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 18:39:52 +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 ) {
|
'toDomElement': function( subType, annotation ) {
|
||||||
if ( annotation.type ) {
|
if ( annotation.type ) {
|
||||||
var link = document.createElement( 'a' );
|
var link = document.createElement( 'a' );
|
||||||
link.setAttribute( 'data-type', 'link/' + subType );
|
link.setAttribute( 'data-type', subType );
|
||||||
|
link.setAttribute( 'href', annotation.data.href );
|
||||||
return link;
|
return link;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -32,7 +33,7 @@ ve.dm.LinkAnnotation.converters = {
|
||||||
// FIXME: the parser currently doesn't output this data this way
|
// FIXME: the parser currently doesn't output this data this way
|
||||||
// Internal links get 'linkType': 'internal' in the data-mw-rt attrib, while external
|
// Internal links get 'linkType': 'internal' in the data-mw-rt attrib, while external
|
||||||
// links currently get nothing
|
// 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