mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 02:23:58 +00:00
Merge "Correct MWImage* resource regex to find literal .s rather than characters"
This commit is contained in:
commit
0af7c2d634
|
@ -157,7 +157,7 @@ ve.dm.MWImageModel.static.createImageNode = function ( attributes, imageType ) {
|
|||
*/
|
||||
ve.dm.MWImageModel.static.newFromImageAttributes = function ( attrs, dir ) {
|
||||
var imgModel = new ve.dm.MWImageModel( {
|
||||
'resourceName': attrs.resource.replace( /^(.+\/)*/, '' ),
|
||||
'resourceName': attrs.resource.replace( /^(\.+\/)*/, '' ),
|
||||
'currentDimensions': {
|
||||
'width': attrs.width,
|
||||
'height': attrs.height
|
||||
|
|
|
@ -159,7 +159,7 @@ ve.dm.MWImageNode.prototype.onAttributeChange = function ( key, from, to ) {
|
|||
ve.dm.MWImageNode.prototype.getFilename = function () {
|
||||
// Strip ./ stuff and decode URI encoding
|
||||
var resource = this.getAttribute( 'resource' ),
|
||||
filename = resource.replace( /^(.+\/)*/, '' );
|
||||
filename = resource.replace( /^(\.+\/)*/, '' );
|
||||
|
||||
// Protect against decodeURIComponent() throwing exceptions
|
||||
try {
|
||||
|
|
Loading…
Reference in a new issue